Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help making this in C Submission Information Submit this assignment by following the instructions given by your TA. SUBMIT ONLY the .c file

image text in transcribed
image text in transcribed
image text in transcribed
I need help making this in C
Submission Information Submit this assignment by following the instructions given by your TA. SUBMIT ONLY the .c file (no a out or executable file is required). All of the lab assignments must be submitted before the end of the lab using the lab code given by the TA. Use the following submit command: mucs submit cclass> cassignment_type> For example: mucs submit 1050 lab lab3.c Filename must be sectionletter-lab3.c (include your respective lab section), e-8., H-ab3.c Description For the lab assignment, you may use any statements you wish. However, you will get bonus points if you correctly solve the problem without using the if statement, the if/else statement, the switch statement, or the while statement. You may find the problem a lot easier if you just go ahead and forget about the bonus, unless you have extra time at the end of lab. If you do want to try the bonus, you really might want to use the conditional operator (also called the ternary operator). You are to write a program that prompts the user for two positive integers that are less than or equal to 200 and greater than or equal to 100. If the user enters an integer that is less than 100 or greater than 200, you must prompt the user again. You must continue checking and prompting the user, until the user enters two positive integers that are less than or equal to 200 and greater than or equal to 100. Call the integers you get from the user Start and Limit respectively. Next, you should prompt for another integer called Increment. If Start is less than Limit then Increment must be positive. If Start is greater than limit then Increment must be negative. Increment must not be zero. You should error-check and continue to prompt the user until these conditions are met. Finally, print all integers starting with Start and ending with Limit (inclusive) and stepping by increment. Check out the sample output if you aren't clear on these requirements. Suggestions Start by writing the program without error-checking and come back and add that later if you have time. Try writing the program so it will work with the simplest case. For example, make it work if Start is 100, Limit is 200, and increment is 10. When that works, worry about the cases where Start is larger than Limit. Don't attempt the bonus until you have it working without the bonus. Page 1 of 3 Sample Output (bold and highlight shows user input) IROJA RArea51:-/CS10se/sp2o2es compile lab3.c Example Run JAMRJim Area51:-/C51050/sp2020$ ./a.out Enter Start: 110 Enter Limit: 150 Enter Increment: 1e 119 120 130 140 150 Example Run 2 JimR9JinRArea51:-/CS185e/sp2e2es ./a.out Enter Start: Enter Start: Enter Start: 107 Enter Limit: 120 Enter Increment: Enter Increment: Enter Increment: 2 107 109 111 113 115 117 118 119 Example Run 3 JimRQJ imRArea51:-/CS1050/sp2020$ ./a.out Enter Start: 999999 Enter Start: 999999 Enter Start: Enter Start: Enter Start: 180 Enter Limit: 999999 Enter Limit: Enter Limit: Enter Limit: 140 Enter Increment: 99 Enter Increment: Enter Increment: -20 180 160 140 Guidelines for Grading Lab 3 40 Points Possible (+5 Bonus) General If your program does not compile or produce any input/output then your lab will receive a grade of zero points. You will receive zero points if your program merely simulates functioning correctly (for example, if you just use printf to make the output match a sample run, you get zero). 10 points: Program works for the case where Start Limit (and Increment is negative) 5 points: Program correctly error-checks that Start is in the range 100 to 200 inclusive and continues to prompt until this condition is met. 5 points: Program correctly error-checks that limit is in the range 100 to 200 inclusive and continues to prompt until this condition is met. 10 points: Program correctly error-checks that increment is positive when Start Limit and negative when Start > Limit and continues to prompt until this condition is met. 5 bonus points: Program works correctly and it does not contain a while, if, if/else, or switch statement

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 Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions