The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Please include all the codes in the word document.
Â
OverviewThis hands-on lab allows you to follow and experiment with the critical steps ofdeveloping a programincluding the program description, analysis, test plan, design, andimplementation with C code. Theexample provided uses sequential, repetition, selection statements and two user-defined function.Program DescriptionThis program will provide options for a user to calculate the square or cube of apositive Integer input bya user. The program will prompt the user to enter an Integer and then prompt theuser if they want tocalculate the square of the cube of the number. Based on the inputs of the user,the program will outputthe square of the cube of the positive integer. The program will then print theInteger and square orcube of the integer based on the user’s original choice. The program will continueto prompt the user forIntegers and their calculation choice until the user enters a negative integer. Thesquare and cubecalculations should be calculated using a function.AnalysisI will use sequential, selection, and repetition programming statements andfunctions for the cube andsquare calculations.I will define three Integer numbers: IntValue, MenuSelect, Results to store theInteger value input by theuser, the Menu selection (1 for Square, 2 for Cube) of the user, and the results ofthe Square or Cubefunctions.The Square function will take one Integer as input and return one Integer as theoutput. The calculationwithin the Square function is: Results = IntValue * IntValueFor example, if 10 was entered as the IntValue. Results = 10*10 = 100The Cube function will take one Integer as input and return one Integer as theoutput. The calculationwithin the Cube function is: Results = IntValue * IntValue*IntValueFor example, if 10 was entered as the IntValue. Results = 10*10*10 = 1000A repetition loop can be used to loop through iterations until a negative isentered:while(intValue > 0) (…End For2Test Plan
Attachments:
-----------