What are the two floating point types in c and how do they


Part 1: Your city's parking violation bureau wants you to write a program to compute fines for parking violations There are four types of violation: type A carries a fine of $10, type B carries a fine of S20, type C carries a fine of S30, and type D carries a fine of $50.The program should ask for the number of type A violations, the number of type B violations, and so on. The program should display the total fine for the person.

Part 2: Write a program that asks the user to enter a student's grades on four exams. The program should display the four grades and the average of the four grades, rounded to the nearest tenth. To add the grades, use a variable called total_grade, which you should initialize to zero. As the program prompts for and obtains each grade, add the grade to total_grade using the += operator.

REVIEW EXERCISES

1. What are the two floating point types in C++ and how do they differ?
2. How can you use the setprecision() and setiosflags() manipulators to control the output of decimal numbers?
3. Explain how C++ handles an arithmetic expression that contains different numeric data types.
4. What is a type cast and how do you make one? Why is a type cast sometimes necessary?
5. How are data types converted across the assignment operator?
6. What is the value of an assignment expression?
7. Explain how a multiple assignment works
8. What are the compound assignment operators and how do they work?
9. What are the increment and decrement operators and how do they work?
10. What is the difference between pre- and postincrement?

Text Book: C++ For Business Programming Second Edition John C Mulluzzo.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: What are the two floating point types in c and how do they
Reference No:- TGS01516453

Now Priced at $50 (50% Discount)

Recommended (91%)

Rated (4.3/5)