CPSC 250  Final Test

$30.00

Download Details:

  • Name: Final-Programming-1h4ikv.zip
  • Type: zip
  • Size: 31.01 KB

Category:

Description

5/5 - (1 vote)

Brief statement

Input hours worked and pay rate then output gross pay

Explanation.

This program is structured like Huron’s formula.   In that case you inputted 3 numbers, computed a number called area and outputted that number

In this program you input the hours worked and pay rate.  Both are 64-bit floats.  The formula for gross pay is the following.

First:  gross_pay equal  hours_worked times pay_rate

If the hours_worked is greater than 40.0 then the following overtime is added to gross_pay:

 

overtime =  0.5 x (hours_worked – 40.0) x pay_rate

Calling diagram

Sample dialogue

Please enter hours worked:  44.0

Please enter pay rate: 10.50

The total pay is $ 483.00

The driver received 483.0000 and will keep it.

 

Bye.

 

 

 

 

//The text in yellow is produced by compute.asm.  Everything else is from the driver.

 

Sample dialog with error

 

CPSC 240-5 Final

 

Please enter hours worked:  4R.00

 

Error try again:  25.75

 

Please enter pay rate: 10TF.23

 

Error try again: 6YY

 

Shut down.  You may run this program again.

 

The driver received 0.0 and will keep it.

 

Bye.

 

 

 

 

 

 

 

//The user receives only one chance to fix an input error.

 

//After two consecutive failed input the program quits.

 

//Validation for positive inputs only is not required in this program.

Some data sets for testing your programmed

 

 

Pay rate = 5.00

Hours       3.5

Expected answer = 17.50

 

 

Pay rate:     22.70

Hours         11.2

Expected answer = 254.24

 

 

Pay rate:      15.25

Hours           52.00

Expected answer = 884.50

 

 

Pay rate:        1.00

Hours          100.0

Expected answer = 130.00

 

 

 

 

Special software engineering for this test only

 

You may omit 15 backup pushes and 15 backup pops

 

The compute module does everything important:

==> get the two inputs,

==> validate each input

==> compute the total pay,

==> output the total pay

==> return the total pay

 

Your name, your CWID, and “Dec 14, 2020” are the only required identifying comments.

 

If you borrowed files from another assignment like Huron’s program, then keep the license and the comments.

 

Finished

 

You know what to do.  Send all the files of the “Gross Pay” program

Source files

Bash file

Picture ID

 

to me at the usual place: