Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I took an intro to C program this summer and one of my homework is run a full flowchart and an input process output table

I took an intro to C program this summer and one of my homework is run a full flowchart and an input process output table for following two questions, can anyone teach or help me on that, thank you so much, by the way, if you not able to provide for the table for the input and process output, please show me how to make a flowchart for both questions ( (Hint: flowchart and IPO (input process output is not asked you to write step or explained or a code for c language)

1. A program is required that prompts the user for a number between 1 and 20. The prompt should also tell the user "enter 0 to end". The program will then print a series of asterisks to represent the number. If the user enters 0, the program stops. If the user enters anything larger than 20 or less than zero, an "invalid input" will be reported and the program waits for the next input. The asterisk should be printed using a loop. You can develop a function called prinrStar(n) that gets n and prints n asterisk.

Sample run:

Enter a number between 1 and 20. Enter 0 to end: 5

*****

Enter a number between 1 and 20. Enter 0 to end: 99

invalid input!

Enter a number between 1 and 20. Enter 0 to end: 13

*************

Enter a number between 1 and 20. Enter 0 to end: 0

Thanks and bye!

2.In this assignment we will develop an application to calculate the area and perimeter of geometric shapes. First the user is asked to enter a letter representing the shape. We use C for circle, R for rectangle and S for square.

After the user chooses the shape, the program prompts for the appropriate dimensions of the shape accordingly. For instance, if the user has chosen a square, the program will ask for a side. If it's a circle, the program will ask for radius. If it's a rectangle, it will ask for length and width. An invalid input will be reported and the user should enter the letter again.

Upon receiving the appropriate dimensions, the program will calculate the area and the perimeter of the requested shape and print it on the screen. And again, the code will ask for another letter. If the user enters 'Q' the program terminates.

This program must be implemented using modules. Upon choosing the shape by the user, a corresponding function should run to do the rest.

One run of the program will look like this:

Please Enter Shape (C: Circle, S: Square, R: Rectangle Q:quit) >S

Please enter the side of the square > 8

The area is 64 and the perimeter is 32

Please Enter Shape (C: Circle, S: Square, R: Rectangle Q:quit) >R

Please enter the width of the rectangle > 5

Please enter the length of the rectangle > 7

The area is 35 and the perimeter is 24

Please Enter Shape (C: Circle, S: Square, R: Rectangle Q:quit) >Q

Thanks and bye!

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions