CS365 – Cost of a product and the amount of cash paid for the product Solved

30.00 $ 15.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

Rate this product

Objective

Familiarity with the BASIC programming language

Familiarity with older styles of programming

Assignment Part 1

Ask the user for a cost of a product and the amount of cash paid for the product.

If the amount paid is less than the cost, display a statement stating that an insufficient amount has the paid and end the program.

If the amount paid if greater or equal to the cost of the program, display on screen the total amount of change and then the change in whole dollars, quarters, dimes, nickels and pennies. All output must have labels. All change output other than the overall amount of change must be in whole numbers. Do not worry about rounding errors – it is acceptable if the number of pennies is off by one.

Challenge – right justify the numeric output, including two decimal places after the decimal point for the cost, amount paid, and amount of change.

Part 2

Write a loop that counts from 1 to the 100. For all values that are multiples of three print “Fizz”. For all values that are multiples of five print “Buzz”. For all values that are multiples of both print

“FizzBuzz”. For all other values print out just the value.

Due Date

Requirements

A comment section with your name, program number, part (if relevant) and email address

All programs must be named progXYABC.bas where:

  • is the program number (5 in this case).
  • is the part number. Use a for 1, b for 2, and so on ABC are your initials. I would use TLS.

This naming scheme should ensure that every file turned in this semester has a unique name. My programs for this assignment would be prog1aTLS.bas and prog1bTLS.bas.

No error checking is required other than for conditions specifically stated in the assignments.

The only valid control commands for this program are:

  • IF-THEN GOTO lineNumber statements – No END IF or ELSE statements
  • GOTO statements

All lines must have a line number. Line labels CANNOT be used.

Programs may terminate naturally or by using the STOP or SYSTEM command.

Documentation for Bywater BASIC is available on Blackboard.

 

  • prog5EC-qxjsgm.zip