there are 3 member functions.1st one to set value for person discount,distance.second one to display personcount,distance and fair .3rd function to caliculate the fair with assumption that fair for 1 person is 300rupees if distance>=1200km and 200 rs for<500kmand for in between distance it is 350 rupees write c++pgm
Define a class called CUSTOMER with the following members name_of_the_customer type_of_loan number_of_months principal_amount EMI There are 3 member functions. First one to set the value for name_of_the_customer, number_of_months, principal_amount and type_of_loan. Second one to print all the data members. Third function to calculate EMI and it is calculated as follows. If type_of_loan is “bike” then monthly interest rate is 9.2%. If type_of_loan is “Home” then monthly interest rate is 7.35%.
The diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,
find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole
number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.
Sample Run 1
Welcome to CS126 Mart!
Item Codes Description Price
100 Sweet ‘n Ripe Grapes 125.35
101 Crunchy Apples 52.20
109 Green Peas 25.75
Enter Code: 128
Invalid code, please enter a valid one.
Enter Code: 100
Sweet ‘n Ripe Grapes 125.35
Quantity -3
Invalid Quantity, please enter again.
Quantity 2
Subtotal: 250.70
Enter Code: 101
Crunchy Apples 52.20
Quantity 1
Subtotal: 52.20
Enter Code: 0
Total Amount Due: 302.90
Cash: 100.00
Insufficient Cash!
Cash: 1000.00
Change: 697.10
=========== CHANGE BREAKDOWN ===========
1000 0 0
500 1 500.00
200 0 0
100 1 100.00
50 1 50.00
20 2 40.00
10 0 0
5 1 5.00
1 2 2.00
0.25 0 0
0.10 1 0.10
0.05 0 0
Do you want another transaction? <y/n> No.
Sample Run 1
Welcome to CS126 Mart!
Item Codes Description Price
100 Sweet ‘n Ripe Grapes 125.35
101 Crunchy Apples 52.20
109 Green Peas 25.75
Enter Code: 128
Invalid code, please enter a valid one.
Enter Code: 100
Sweet ‘n Ripe Grapes 125.35
Quantity -3
Invalid Quantity, please enter again.
Quantity 2
Subtotal: 250.70
Enter Code: 101
Crunchy Apples 52.20
Quantity 1
Subtotal: 52.20
Enter Code: 0
Total Amount Due: 302.90
Cash: 100.00
Insufficient Cash!
Cash: 1000.00
Change: 697.10
=========== CHANGE BREAKDOWN ===========
1000 0 0
500 1 500.00
200 0 0
100 1 100.00
50 1 50.00
20 2 40.00
10 0 0
5 1 5.00
1 2 2.00
0.25 0 0
0.10 1 0.10
0.05 0 0
Do you want another transaction? <y/n> No.
Write a Program: Print a table of stars and zeroes
print a square table of alternating stars and zeroes.
Ask the user to enter a size of the table. The number should be odd. Since the table is square the number of rows and columns will be the same and should be equal to the entered size. The valid range for the size is from 3 to 15, inclusive.
Use a loop to make sure the entered size is odd and within the range. Output a descriptive error message if an invalid size is entered. The error message should indicate if the size is even, or less than the minimum, or larger than the maximum.
Each row in said table should have ‘*’ and ‘0’ symbols separated by a space. Each column of the table should also have alternating ‘*’ and ‘0’ symbols. All corners should have the ‘*’ symbol.
enter an odd size from 3 to 15: 3
* 0 *
0 * 0
* 0 *
Exercise 3: Practice to manipulate data in arrays Write a C program to create an integer array called Motion of size 5. Ask the user to enter values to the array from the keyboard. Rotate the values of the array by one position in the forward direction and display the values.
Ex: number in index 4 should move to index 3, Number in index 3 should move to index2, number index 0 should move to index 4.
Initial values 10 6 8 2 9
After rotating 6 8 2 9 10
Exercise 1: Practice to store and print data in an array
a) Write a C program that reads marks of 10 students in to a single subscripted array.
b) Above marks should be between 0 to 20. Modify the above program to add marks to the array only if the input mark is between the given range.
c) Display the values stored in the array.