Write the code that will read in four whole numbers


Problem

Put the following in one program:

A. Write the code that will read in a floating-point number from the user. Next print the number in decimal-point notation and then in exponential notation. For example:

The input is 210.290000 or 2.129000e+002

B. There are approximately 3.156 x 107 seconds in a year. Write the code that requests your age in years and then displays the equivalent number of seconds. Assume 365 days a year. For example:

Enter your age in years? 30
You age in seconds is ##.

C. The mass of a single molecule of water is about 3.0 x 10-23 grams. A quart of water is about 950 grams. Write the code that requests an amount of water, in quarts, and displays the number of water molecules in that amount. Be sure to test your answer with a calculator (start/all programs/accessories/calculator).

D. Write the code that will read in four whole numbers from the user. Print out the largest of the four numbers.

E. Write the code that will read in a year from the user. If the year is greater than 1500 and less than 2200, determine if it's a leap year or not. Print out "Invalid Year", "Yes, #### is a leap year" or "No, #### is not a leap year." Years that are evenly divisible by 4 are leap years. Years evenly divisible by 100 are a special case. If the year is evenly divisible by 100 it is a leap year only if it is also evenly divisible by 400. That means 1600 is a leap year but 1700, 1800 and 1900 are not.

F. Write the code that will read in the following from the user: Hourly Pay Rate, Hours Worked. If both values read in are positive, calculate the net pay. To calculate the net pay, first calculate the gross pay. The gross pay is the hours worked times the hourly rate. Next, calculate the taxes. Tax the first $300 dollars at 15%. Tax the next $150 at 20%. Tax the rest at %25. The net pay is equal to the gross pay minus the taxes.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write the code that will read in four whole numbers
Reference No:- TGS03222321

Expected delivery within 24 Hours