Write a program that prompts the user for a positive


Question 1.

Write a program that prompts the user for a positive integer greater than 1. The program should then output either "prime" if the given number is a prime or "composite" otherwise. Recall that an integer is prime if and only if its only divisors are 1 and itself.

Question 2.

  1. Your program should simulate a checkout counter.  It should work like the following example:

Welcome to the checkout counter!  How many items are you purchasing today?

3 (user presses Enter key)

Please enter the name of product 1:

chicken (user presses Enter key)

And how much does chicken cost?  

3.50 (user presses Enter key)

Please enter the name of product 2:  

chips (user presses Enter key)

And how much does chips cost?  

1.25 (user presses Enter key)

Please enter the name of product 3: 

gum (user presses Enter key)

And how much does gum cost?

.99 (user presses Enter key)

Your order was:

chicken $3.50

chips $1.25

gum $.99

Your subtotal comes to $5.74.  With 9% sales tax, your total is $6.19.

Please enter cash amount:

20.00 (user presses Enter key)

I owe you back $13.81. 

Thank you for shopping with us!

Hint: You will need two separate lists for question 2.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program that prompts the user for a positive
Reference No:- TGS01350058

Expected delivery within 24 Hours