COMP1200-C – Assign 04 solution

$24.99

Original Work ?

Download Details:

  • Name: assign04.zip
  • Type: zip
  • Size: 64.97 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (3 votes)

Submit assign04a.c, assign04b.c , assign04c.c via Canvas
Before you start writing your program: Read these instructions including the development plan. A development plan is a process that guides you through solving a problem and creating an algorithm. Save a copy of your assign03.c as assign04a.c. The assignment number should reflect a, b, or c also. Modify the problem description as needed to reflect assign04 requirements. Remove the statements that do not apply to the assign04 requirements. Program: assign04a.c The only part of assign03.c that is changed for assign04a.c is the input. Add a do..while loop around the printf/scanf used for user input. Your program should reprompt the user when an angle value outside the range in entered. Program: assign04b.c Save a copy of your assign04a.c as assign04b.c. Change the do..while loop to a while loop to re-prompt the user when an angle value outside the range in entered. Program: assign04c.c Prompt the user for the number of angles to be entered. Use a for loop around the data validation loop. Add a comment for this new loop. You may use either a do..while or while loop to re-prompt the user when an angle value outside the range in entered. Save a copy of your assign04a.c or assign04b.c as assign04c.c. Add a comment above the new prompt and loop. Instructions:  See Standards for Documentation of C Programs on the Resources page on Canvas.  Insert comments at the top and throughout each file. o Include the follow comments at the beginning of this (and ALL) files. // submitter’s name, GROUP # Grade of ZERO for files with submitter name not part of Canvas group // other group members’ names Type “none” if submitting alone. // assignment number Zero points for comments if no collaboration statement // date you completed the assignment // statement(s) about collaboration // a short narrative about what the file does o Use the algorithm given as comments throughout your program.  Use descriptive variable names.  Use Sample Input/Output as a guide.  Use Generate CSD to ensure correct indenting.  Represent ALL given values as constants.  Format the angle with 1 decimal place.  Format the building height with 2 decimal places.  Label output using the printf()function in sentence form. Sample Output: assign04a.c and assign04b.c Enter an angle in degrees (min=27.0, max=33.0): 23 Enter an angle in degrees (min=27.0, max=33.0): 37 Enter an angle in degrees (min=27.0, max=33.0): 31 Using 31.0 degrees, the building height is 72.10 meters. assign04c.c Enter the number of angles to be entered: 3 Enter an angle in degrees (min=27.0, max=33.0): 27 Using 27.0 degrees, the building height is 61.14 meters. Enter an angle in degrees (min=27.0, max=33.0): 23 Enter an angle in degrees (min=27.0, max=33.0): 37 Enter an angle in degrees (min=27.0, max=33.0): 30 Using 30.0 degrees, the building height is 69.28 meters. Enter an angle in degrees (min=27.0, max=33.0): 29.8 Using 29.8 degrees, the building height is 68.72 meters.