Shopping Cart
0 item(s) - \$0.00
\$7.00

# CMIS 102 Week 4 Hands on Lab

This Tutorial was purchased 3 times & rated A by student like you.

# Attachment

• CMIS 102 Week 4 Hands on Lab 1.docx
• CMIS 102 Week 4 Hands on Lab.docx

CMIS 102 Hands-On Lab
Week 4
Overview
This hands-on lab allows you to follow and experiment with the critical steps of developing a program
including the program description, analysis, test plan, design (using pseudocode), and implementation
with C code. The example provided uses sequential and selection statements.
Program Description
This program will calculate the sum of 5 integers. The program will ask the user to 5 integers. If the sum
of the numbers is greater than 100, a message is printed stating the sum is over 100. The design step will
include both pseudocode.
Analysis
I 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 sum
of the 5 values.
The sum will be calculated by this formula:
sum = value1 + value2 + value3 + value4 + value5
For example, if the first values entered were value 1=1, value 2=1, value 3=2,value 4=2 and value 5=3
respectively:
sum = 1 + 1 + 2 + 2 + 3 = 9
The additional selection statement will be of this form:
If sum &gt; 100 then
print &quot;Sum is over 100&quot;
End If Test Plan
To verify this program is working properly the input values could be used for testing:
Test Case
1 2 Input
value1=1
value2=1
value3=1
value4=0
Value5=2
value=100
value=100
value=100
value=100
value=200 Expected Output
Sum = 5 Sum = 600
Sum is over 100. 1 3 value= -100
value= -100
value= -200
value = 0
value= 200 Sum = -200 Pseudocode
// This program will calculate the sum of 5 integers.
// Declare variables
Declare value1, value2, value3, value4, value5, sum as Integer
//Initialize Sum to 0
Set sum = 0
// Enter
Print
Input
Print
Input
Print
Input
Print
Input
Print
Input values
“Enter
value1
“Enter
value2
“Enter
value3
“Enter
value4
“Enter
value5 an Integer for value1”
an Integer for value2”
an Integer for value3”
an Integer for value4”
an Integer for value5” // Calculate sum
sum = value1 + value2 + value3 + value4 + value5
// Print results and messages
Print “Sum is “ + sum
If (sum &gt; 100)
Printf “Sum is over 100”
End if C Code
The following is the C Code that will compile in execute in the online compilers.
// C code
// This program will calculate the sum of 5 integers.
// Developer: Faculty CMIS102
// Date: Jan 31, XXXX
#include &lt;stdio.h&gt;
int main () 2 {
/* variable definition: */
int value1,value2,value3,value4,value5,sum; /* Initialize sum */
sum = 0;
printf(&quot;Enter an Integer
scanf(&quot;%d&quot;, &amp;value1);
printf(&quot;Enter an Integer
scanf(&quot;%d&quot;, &amp;value2);
printf(&quot;Enter an Integer
scanf(&quot;%d&quot;, &amp;value3);
printf(&quot;Enter an Integer
scanf(&quot;%d&quot;, &amp;value4);
printf(&quot;Enter an Integer
scanf(&quot;%d&quot;, &amp;value5); for value1\n&quot;);
for value2\n&quot;);
for value3\n&quot;);
for value4\n&quot;);
for value5\n&quot;); sum = value1 + value2 + value3 + value4 + value5;
printf(&quot;Sum is %d\n &quot; , sum );
if (sum &gt;100)
printf(&quot;Sum is over 100\n&quot;);
return 0;
} Setting up the code and the input parameters in ideone.com:
Note the input integer values are 100, 100, 100, 200 and 100, for this test case. You can change these
values to any valid integer values to match your test cases. 3 Results from running within ideone 4 Learning Exercises for you to complete
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.
Submit your document no later than the due date listed in the syllabus or calendar.
Submission
Demonstrates the successful execution of this Lab within an
online compiler. Provides supporting screen captures.
Modifies the C code to sum 10 integers as opposed to 5.
Supports your experimentation with screen captures of
executing the code.
Using the code created in step 1, modifies the code to print
an additional statement if the sum of the value is negative
Supports your experimentation with a screen capture of
executing the new code.
Provides a new test table with at least 3 distinct test cases
listing input and expected output for the code you created
after step 2.
Creates your own unique C code implementation of one of
the provided mathematical formulas. Provides a new test
table with at least 3 distinct test cases listing input and
expected output your mathematical formula. Supports your
experimentation with a screen capture of executing the new
code.
Document is well-organized, and contains minimal spelling
and grammatical errors.
Total Points
2
2 2 1 2 1
10 6

## Write a review

Order Id

Order Id will be kept Confidential

Rating:   A   B   C   D   F

Enter the code in the box below:

Related Tutorials
 \$7.00 CMIS 102 Homework 4 Create your own Function This Tutorial was purchased 5 times & rated A+ by student like you. Create your own function in C that accepts one input parameter and returns a float number. You decide the theme. You should provide both your C code and an example call to the C code function. Be sure to provide an overview of what your function is doing. Provide a screen capture showing ....
 \$7.00 CMIS 102 Homework 1 Solution (100% Correct) This Tutorial was purchased 2 times & rated A+ by student like you. CMIS 102 Homework 1 Solution Introduction to Problem Solving and Algorithm Design   Using the above Code of Ethics, Pick at least 2 of the 8 principles and describe what these principles mean to you. In your write-up, summarize the principles you selected in your own words and pr....
 \$7.00 CMIS 102 Homework 3 (100% Correct) This Tutorial was purchased 3 times & rated A+ by student like you. Create your own unique While-End or (For End) repetition C code. You decide the theme. Be sure to provide an overview of what your repetition structure is doing. Please keep the design simple for this exercise. Just a few lines of code is all that is needed for this response. This should be code ....
 \$7.00 CMIS 102 Homework 2 Test Case Creation Using the following pseudocode (100% Correct) This Tutorial was purchased 8 times & rated A+ by student like you. Homework 2 – Test Case Creation Using the following pseudocode, provide 3 unique test cases that would help validate your algorithm. Be sure to place the test cases in a table showing the input https://www.coursehero.com/tutors-problems/Computer-Science/10754291-I-need-help-with-c-coding-asap....
 \$7.00 CMIS 102 Week 4 Hands on Lab This Tutorial was purchased 3 times & rated A by student like you. CMIS 102 Hands-On Lab Week 4 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design (using pseudocode), and implementation with C code. The example provided u....
 \$7.00 CMIS 102 Week 2 Hands-On Lab This Tutorial was purchased 6 times & rated A+ by student like you. CMIS 102 Week 2 Hands-On Lab Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, and implementation with C code. Program Description This program will sum two....
 \$7.00 CMIS 102 Week 6 Hands-On Lab This Tutorial was purchased 5 times & rated A+ by student like you. CMIS 102 Week 6 Hands-On Lab Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design and implementation with C code. The example provided uses sequential, repetition state....
 \$7.00 CMIS 102 Week 1 Hands-On Lab This Tutorial was purchased 4 times & rated A by student like you. CMIS 102 Week 1 Hands-On Lab This hands-on lab demonstrate a simple sequential print statements using an online C compiler such as ideone.com. You should follow the instructions to complete the lab as well as perform the learning exercises at the end of this lab. Instructions 1. Open ....
 \$7.00 CMIS 102 Week 3 Hands-On Lab This Tutorial was purchased 8 times & rated A+ by student like you. CMIS 102 Week 3 Hands-On Lab Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, pseudocode visualization, and implementation with C code. The example provided uses m....
 \$7.00 CMIS 102 Week 5 Hands-On Lab This Tutorial was purchased 4 times & rated A by student like you. CMIS 102 Week 5 Hands-On Lab Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design (using pseudocode), and implementation with C code. The example provided uses sequenti....
 \$7.00 CMIS 102 Week 7 Hands-On Lab This Tutorial was purchased 5 times & rated A+ by student like you. CMIS 102 Week 7 Hands-On Lab Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, and implementation with C code. The example provided uses sequential, repetit....
 \$7.00 CMIS 102 Week 8 Hands-On Lab This Tutorial was purchased 4 times & rated A by student like you. CMIS 102 Week 8 Hands-On Lab Overview: This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), Test Plan, and implementation with C code. The example provided use....
Tags: