Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

I need an urgent help with the solution of this assignment.

 

I need an urgent help with the solution of this assignment. Kindly find attached the details.

1CMIS 102 Hands-On LabWeek 7OverviewThis hands-on lab allows you to follow and experiment with the critical steps of developing a programincluding the program description, analysis, test plan, design, and implementation 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 a positive Integer input bya user. The program will prompt the user to enter an Integer and then prompt the user 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 the Integer and square orcube of the integer based on the user’s original choice. The program will continue to prompt the user forIntegers and their calculation choice until the user enters a negative integer. The square and cubecalculations should be calculated using a function.AnalysisI will use sequential, selection, and repetition programming statements and functions for the cube andsquare calculations.I will define three Integer numbers: IntValue, MenuSelect, Results to store the Integer value input by theuser, the Menu selection (1 for Square, 2 for Cube) of the user, and the results of the Square or Cubefunctions.The Square function will take one Integer as input and return one Integer as the output. 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 the output. 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 is entered:while(intValue > 0) (End For
Background image of page 1
2Test PlanTo verify this program is working properly the input values could be used for testing:Test CaseInputExpected Output1IntValue=10MenuSelect=1Square of 10 is 1002IntValue=10MenuSelect=2Cube of 10 is 10003intValue=-1MenuSelect=N/AProgram exitsPseudocode// This program will provide options for a user to calculate the square// or cube of a positive Integer input by a user.// Start Main programMain// Declare variablesDeclare intValue, menuSelect,Results as Integer// Set intValue to positive value to start loopSet intVal = 1;// Loop While input is a positive numberWhile intValue > 0Print “Enter a positive Integer:”Input intValue// Only perform menu and function calls is integer is positiveIf intValue > 0 ThenPrint “Enter 1 to calculate Square, 2 to Calculate Cube “Input menuSelectIf menuSelect == 1Then// Call the Square FunctionSet Results = Square(intValue)Print intValue,ResultsElse IfmenuSelect == 2 Then// Call the Cube functionset Results = Cube(intValue)Print intValue,ResultsElsePrint “Invalid menu item, only 1 or 2 is accepted”End IfEnd IfEND While// End of Main programEnd Program
Background image of page 2
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"