Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Using repetition and function, ask the user to enter a number N and find the factorial for N(20 Marks). 2. Write a program that

image text in transcribedimage text in transcribed

1. Using repetition and function, ask the user to enter a number N and find the factorial for N(20 Marks). 2. Write a program that prints the following diamond shape. You should ask the user to enter the number of the half of the diamond rows, as shown in the next figure. You should use function to create the diamond shape, and call that function from the main function(20 marks). nter the number of half of the rows: 10 3. A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximum charge for any given 24- hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that will calculate and print the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format, and should calculate and print the total of yesterday's receipts. The program should use the function calculateChargesto determine the charge for each customer. Your outputs should appear in the following format (30 marks): Enter the hours parked for 3 cars: 2 3 6 Charge 2.00 2.00 3.50 7.50 car Hours 2 3.0 6.0 11.0 TOTAL 4. Write a C program (You should use Function)that plays the game of guess the number" as follows Your program chooses the number to be guessed by selecting an integer at random in the range 1 to 1000. The program then types: I have a number between 1 and 1000 Can you guess my number? Please type your first guess The player then types a first guess. The program responds with one of the following 1. Excellent! You quessed the number! Would you like to play again (y or n)? 2. Too 1ow. Try again 3. Too high. Try again If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too high or Too low to help the player "zero in" on the correct answer. (30 marks)

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions

Question

At what level(s) was this OD intervention scoped?

Answered: 1 week ago