Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a program that displays the following pattern: * *** ***** ******* ***** **** 2. sales Tax Write a program that will ask the

1. Write a program that displays the following pattern:
*
***
*****
*******
*****
****
2. sales Tax
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the pur- chase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax). Hint: Use the value 0.02 to represent 2 percent, and 0.04 to represent 4 percent.
3.Write a program that asks the user to enter three test scores. The program should display each test score, as well as the average of the scores.
4. Write a program that computes the tax and tip on a restaurant bill. The program should ask the user to enter the charge for the meal. The tax should be 6.75 percent of the meal charge. The tip should be 20 percent of the total after adding the tax. Display the meal charge, tax amount, tip amount, and total bill on the screen.
5.Kathryn bought 600 shares of stock at a price of $21.77 per share. She must pay her stock- broker a 2 percent commission for the transaction. Write a program that calculates and displays the following:
The amount paid for the stock alone (without the commission)
The amount of the commission
The total amount paid (for the stock plus the commission)
6.Write a program that plays a word game with the user. The program should ask the user to enter the following:
His or her name
His or her age
The name of a city
The name of a college A profession
A type of animal
A pets name
After the user has entered these items, the program should display the following story, inserting the users input into the appropriate locations:
There once was a person named NAME who lived in CITY. At the age of AGE, NAME went to college at COLLEGE. NAME graduated and went to work as a PROFESSION. Then, NAME adopted a(n) ANIMAL named PETNAME. They both lived happily ever after!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago

Question

2 The role of economic theory in economics.

Answered: 1 week ago