ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 9.00

1CMIS 102 Hands-On LabWeek 4

  1. Demonstrate you successfully followed the steps in this lab by preparing screen captures of you running the lab as specified in the Instructions above.
  2. Change the C code to sum 10 integers as opposed to 5? (Hint: Please don’t use arrays or Loops for this. We will be using those features in another week.) Support your experimentation with a screen capture of executing the new code
  3. Using the code you create in step 1, modify the code to print an additional statement if the sum of the value is negative (Hint: Consider modifying the existing selection statement) Support your experimentation with a screen capture of executing the new code.
  4. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created after step 2.
  5. Create your own C code implementation of one of the following mathematical formulas: a. y = mx + b; (slope of a line) Assume the user will be prompted to input m, x and b and the program will calculate y. If the value of y is greater than 10, inform the user the value is greater than 10. b. a = PI * r*r; (area of circle). Assume the user will be prompted to input the radius r. You can define PI as 3.1416. . If the value of a is greater than 10, inform the user the value is greater than 10. c. v = 4/3 PI r*r*r; (volume of sphere) Assume the user will be prompted to input the radius r. You can define PI at 3.1416. If the value of v is greater than 10, inform the user the value is greater than 10. Be sure you provide not only the C code but a test table with at least 3 distinct test cases listing input and expected output your mathematical formula.

Submission

Submit a neatly organized word (or PDF) document that demonstrates you successfully executed this lab on your machine using an online compiler. You should provide a screen capture of the resulting output. Submit all C code you created in files.

Also, provide the answers and any associated screen captures of your successful completion of exercises 1, 2, 3 and 4.

 

1CMIS 102 Hands-On LabWeek 4OverviewThis hands-on lab allows you to follow and experiment with the critical steps of developing a programincluding the program description, analysis, test plan, design (using pseudocode), and implementationwith C code.The example provided uses sequential and selection statements.Program DescriptionThis program will calculate the sum of 5 integers. The program will ask the user to 5 integers. If the sumof the numbers is greater than 100, a message is printed stating the sum is over 100. The design step willinclude both pseudocode.AnalysisI will use sequential, and selection programming statements.I will define six integer numbers: value1, value2, value3, value4, value5 and sum. The value1, value2,value3, value4 and value5 variables will store the integers input by the user. The sum will store the sumof the 5 values.The sum will be calculated by this formula:sum = value1 + value2 + value3 + value4 + value5For example, if the first values entered were value 1=1, value 2=1, value 3=2,value 4=2 and value 5=3respectively:sum = 1 + 1 + 2 + 2 + 3 = 9The additional selection statement will be of this form:If sum > 100 thenprint "Sum is over 100"End IfTest PlanTo verify this program is working properly the input values could be used for testing:Test CaseInputExpected Output1value1=1value2=1value3=1value4=0Value5=2Sum = 52value=100value=100value=100value=100value=200Sum = 600Sum is over 100.

Attachments:

Answers

(11)
Status NEW Posted 11 May 2017 12:05 AM My Price 9.00

-----------

Not Rated(0)