Code a program that ask a leper to enter the number of rows then it prints the number of rows in pyramids of stars as shown below
*
* * *
* * * *
* * * * *
* * * * * *
Write a C++ program that will prompt the user to enter the detail of a car as shown on
Question 2: Write the class definition for a Car class. Provide the following data members: A C-string called make of size 20 to store the car manufactures name, e.g. Ford, Toyota, ….; In integer called year to hold the year of first registration of the vehicle; A floating point called km to contain the number of kilometers traveled for the trip; A floating point called liter to contain the liters used to cover the distance; A floating point called consumption is the calculated value of liter per km. Class-wide floating point called expense, for the cost per kilometer, which should be initialized to R7.55.
Create a python program that will accept positive or negative number and store it to a list. Accepting input will stop when empty input is encountered. Count and display all positive and negative number input and its index number in the list. Count and display all even and odd positive numbers and its index number. Exclude 0 input.
Example Output:
number 1: 78
number 2: 91
number 3: -5
number 4: 0
number 4: 8
number 5: -100
number 6: -2
number 7: 100
number 8:
There are 4 positive numbers
All positive numbers: 78 91 8 100
Positive numbers can be found at index number: 0 1 3 6
There are 3 negative numbers
All negative numbers: -5 -100 -2
Negative numbers can be found at index number: 2 4 5
There are 3 positive even numbers
Positive even numbers are: 78 8 100
Positive even numbers can be found at index: 0 3 6
There are 1 positive odd numbers
Positive odd numbers are: 91
Positive odd numbers can be found at index: 1
Write an algorithm for a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to input the total, before taxes and the tip percentage (15% or 20%). Produce output showing the calculated values including the total amount due for both the 15% and the 201% tips. Tax of 9% should be added to the bill before the tip is determined. Display subtotal showing the amount owed prior to applying the tip, show each tip amount and the totals with each tip amount. Be sure to provide labels for values and the totals with each tip amount. Write appropriate methods for your solution.
Write a for loop which will print summation of all the numbers which are divided by 3 and 5 between 30-120.
1. How to declare array in c? Briefly explain the different types of array with simple example.
2. What is the process to create increment and decrement statement in C? Describe the difference between = and == symbols in C programming? Describe the header file and its usage in C programming?
3. Write a program in C to display the cube of the number up to given an integer. Go to the editor
Test Data :
Input number of terms : 5
Expected Output :
Number is : 1 and cube of the 1 is :1
Number is : 2 and cube of the 2 is :8
Number is : 3 and cube of the 3 is :27
Number is : 4 and cube of the 4 is :64
Number is : 5 and cube of the 5 is :125
4. Write a program in C to display the multiplication table of a given integer. Go to the editor
Test Data :
Input the number (Table to be calculated) : 15
Expected Output :
15 X 1 = 15
...
...
15 X 10 = 150
given an amount write a program in python to find a minimum number of currency notes of different denominations that sum to the given amount. Available note denominations are 1000, 500, 100, 50, 20, 5, 1.
Using if...else if statement, make a program that will ask a number and determine if the inputted number is "positive", "negative", or "zero" c++
A storage container only contain one and a half metric ton of sugar one metric ton is approximately 1000 kg’s. Write a C++ program in which, take the amount of sugar in kg’s a bag can hold and the price of sugar (per KG). Calculate the number of bags needed to store one and a half metric ton sugar and the price of each bag.
pseudo
We need to implement some shuffling of two lists. 1. Provide a function which takes two lists and shuffles them. This shuffling should go in an alternating way. First node from first list, second node front second list, third node front first list, 4th node front second list……. So on. If length of list 1 is greater than size of list 2, start again from the first node and follow the same procedure.