SlideShare ist ein Scribd-Unternehmen logo
1 von 10
MD University CMIS 102 Week 4 Hands on Lab
NEW
Check this A+ tutorial guideline at
http://www.assignmentcloud.com/cmis-102-
md-university-/cmis-102-week-4-hands-on-
lab-new
For more classes visit
http://www.assignmentcloud.com/
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
sumof 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 > 100 then
print "Sum is over 100"
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 > 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 <stdio.h>
int main () 2 {
/* variable definition: */
int value1,value2,value3,value4,value5,sum; /*
Initialize sum */
sum = 0;
printf("Enter an Integer
scanf("%d", &value1);
printf("Enter an Integer
scanf("%d", &value2);
printf("Enter an Integer
scanf("%d", &value3);
printf("Enter an Integer
scanf("%d", &value4);
printf("Enter an Integer
scanf("%d", &value5); for
value1n");
for value2n");
for value3n");
for value4n");
for value5n"); sum = value1 + value2 +
value3 + value4 + value5;
printf("Sum is %dn " , sum );
if (sum >100)
printf("Sum is over 100n");
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 labon 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.
5 Grading guidelines
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

Weitere ähnliche Inhalte

Was ist angesagt?

Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functions
ErnesteNtezirizaza
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
Vivek Singh
 

Was ist angesagt? (17)

selection structures
selection structuresselection structures
selection structures
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functions
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
 
Experiment 9(exceptions)
Experiment 9(exceptions)Experiment 9(exceptions)
Experiment 9(exceptions)
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
 
Lab no 2 haris
Lab no 2 harisLab no 2 haris
Lab no 2 haris
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
C chap02
C chap02C chap02
C chap02
 
C chap02
C chap02C chap02
C chap02
 
PYTHON PROGRAMS
PYTHON PROGRAMSPYTHON PROGRAMS
PYTHON PROGRAMS
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
2. Write a programto prompt the user to enter 2 integer values. I...
2.             Write a programto prompt the user to enter 2 integer values. I...2.             Write a programto prompt the user to enter 2 integer values. I...
2. Write a programto prompt the user to enter 2 integer values. I...
 

Ähnlich wie Md university cmis 102 week 4 hands on lab new

OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
gerardkortney
 
Week 2PRG 218Variables and Input and Output OperationsWrite .docx
Week 2PRG 218Variables and Input and Output OperationsWrite .docxWeek 2PRG 218Variables and Input and Output OperationsWrite .docx
Week 2PRG 218Variables and Input and Output OperationsWrite .docx
co4spmeley
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
AASTHA76
 
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
Week 2PRG 218   Variables and Input and Output OperationsYou w.docxWeek 2PRG 218   Variables and Input and Output OperationsYou w.docx
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
melbruce90096
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
melbruce90096
 
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming  EECS 1.docxProject 2Project 2.pdfIntroduction to Programming  EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
wkyra78
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
tiffanyd4
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
IIUM
 

Ähnlich wie Md university cmis 102 week 4 hands on lab new (20)

Md university cmis 102 week 3 hands
Md university cmis 102 week 3 handsMd university cmis 102 week 3 hands
Md university cmis 102 week 3 hands
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
CMIS 102 Entire Course NEW
CMIS 102 Entire Course NEWCMIS 102 Entire Course NEW
CMIS 102 Entire Course NEW
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 
Week 2PRG 218Variables and Input and Output OperationsWrite .docx
Week 2PRG 218Variables and Input and Output OperationsWrite .docxWeek 2PRG 218Variables and Input and Output OperationsWrite .docx
Week 2PRG 218Variables and Input and Output OperationsWrite .docx
 
Comp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source code
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
 
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
Week 2PRG 218   Variables and Input and Output OperationsYou w.docxWeek 2PRG 218   Variables and Input and Output OperationsYou w.docx
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming  EECS 1.docxProject 2Project 2.pdfIntroduction to Programming  EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
 
c++ Question
c++  Questionc++  Question
c++ Question
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
 
UoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdfUoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdf
 
HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12HSc Computer Science Practical Slip for Class 12
HSc Computer Science Practical Slip for Class 12
 
Jeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testingJeremiah Yancy - Objectives for Software design and testing
Jeremiah Yancy - Objectives for Software design and testing
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 

Mehr von scottbrownnn

Mehr von scottbrownnn (20)

Uop ajs 542 week 1 personal criminological theory new
Uop ajs 542 week 1 personal criminological theory newUop ajs 542 week 1 personal criminological theory new
Uop ajs 542 week 1 personal criminological theory new
 
Ash edu 382 week 5 final paper lesson plan revision and analysis new
Ash edu 382 week 5 final paper lesson plan revision and analysis newAsh edu 382 week 5 final paper lesson plan revision and analysis new
Ash edu 382 week 5 final paper lesson plan revision and analysis new
 
Ash edu 382 week 5 discussion 1 managing a differentiated classroom
Ash edu 382 week 5 discussion 1 managing a differentiated classroomAsh edu 382 week 5 discussion 1 managing a differentiated classroom
Ash edu 382 week 5 discussion 1 managing a differentiated classroom
 
Ash edu 382 week 4 discussion 2 dq 2 culture new
Ash edu 382 week 4 discussion 2 dq 2 culture newAsh edu 382 week 4 discussion 2 dq 2 culture new
Ash edu 382 week 4 discussion 2 dq 2 culture new
 
Ash edu 382 week 3 discussion 2 student interest new
Ash edu 382 week 3 discussion 2 student interest newAsh edu 382 week 3 discussion 2 student interest new
Ash edu 382 week 3 discussion 2 student interest new
 
Ash edu 382 week 3 assignment differentiating for student readiness and inter...
Ash edu 382 week 3 assignment differentiating for student readiness and inter...Ash edu 382 week 3 assignment differentiating for student readiness and inter...
Ash edu 382 week 3 assignment differentiating for student readiness and inter...
 
Ash edu 382 week 2 discussion 2 classroom assessment new
Ash edu 382 week 2 discussion 2 classroom assessment newAsh edu 382 week 2 discussion 2 classroom assessment new
Ash edu 382 week 2 discussion 2 classroom assessment new
 
Ash edu 382 week 2 discussion 1 curriculum new
Ash edu 382 week 2 discussion 1 curriculum newAsh edu 382 week 2 discussion 1 curriculum new
Ash edu 382 week 2 discussion 1 curriculum new
 
Ash edu 382 week 1 discussion 2 teacher and student mindsets new
Ash edu 382 week 1 discussion 2 teacher and student mindsets newAsh edu 382 week 1 discussion 2 teacher and student mindsets new
Ash edu 382 week 1 discussion 2 teacher and student mindsets new
 
Ash edu 382 week 1 discussion 1 the importance of neuroscience in education new
Ash edu 382 week 1 discussion 1 the importance of neuroscience in education newAsh edu 382 week 1 discussion 1 the importance of neuroscience in education new
Ash edu 382 week 1 discussion 1 the importance of neuroscience in education new
 
Ash edu 382 week 1 assignment parent meeting new
Ash edu 382 week 1 assignment parent meeting newAsh edu 382 week 1 assignment parent meeting new
Ash edu 382 week 1 assignment parent meeting new
 
Uop eng 380 week 1 language and linguistics worksheet new
Uop eng 380 week 1 language and linguistics worksheet newUop eng 380 week 1 language and linguistics worksheet new
Uop eng 380 week 1 language and linguistics worksheet new
 
Argosy psy 303 module 5 assignment 1 lasa 2 society
Argosy psy 303 module 5 assignment 1 lasa 2 societyArgosy psy 303 module 5 assignment 1 lasa 2 society
Argosy psy 303 module 5 assignment 1 lasa 2 society
 
Argosy psy 303 module 3 assignment 2 lasa 1 analyzing theories of crime new
Argosy psy 303 module 3 assignment 2 lasa 1 analyzing theories of crime newArgosy psy 303 module 3 assignment 2 lasa 1 analyzing theories of crime new
Argosy psy 303 module 3 assignment 2 lasa 1 analyzing theories of crime new
 
Argosy psy 303 module 1 assignment 3 measures of crime new
Argosy psy 303 module 1 assignment 3 measures of crime newArgosy psy 303 module 1 assignment 3 measures of crime new
Argosy psy 303 module 1 assignment 3 measures of crime new
 
Uop law 421 final guide new
Uop law 421 final guide newUop law 421 final guide new
Uop law 421 final guide new
 
Uop acc 545 final exam guide new
Uop acc 545 final exam guide newUop acc 545 final exam guide new
Uop acc 545 final exam guide new
 
Uop com 295 week 2 knowledge check
Uop com 295 week 2 knowledge checkUop com 295 week 2 knowledge check
Uop com 295 week 2 knowledge check
 
Uop com 295 final guide
Uop com 295 final guideUop com 295 final guide
Uop com 295 final guide
 
Stayer cis 413 week 10 assignment 2
Stayer cis 413 week 10 assignment 2Stayer cis 413 week 10 assignment 2
Stayer cis 413 week 10 assignment 2
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

Md university cmis 102 week 4 hands on lab new

  • 1. MD University CMIS 102 Week 4 Hands on Lab NEW Check this A+ tutorial guideline at http://www.assignmentcloud.com/cmis-102- md-university-/cmis-102-week-4-hands-on- lab-new For more classes visit http://www.assignmentcloud.com/ 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.
  • 2. Program Description This 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 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
  • 3. The additional selection statement will be of this form: If sum > 100 then print "Sum is over 100" 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
  • 4. 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”
  • 5. 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 > 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 <stdio.h> int main () 2 { /* variable definition: */ int value1,value2,value3,value4,value5,sum; /* Initialize sum */ sum = 0; printf("Enter an Integer scanf("%d", &value1); printf("Enter an Integer scanf("%d", &value2);
  • 6. printf("Enter an Integer scanf("%d", &value3); printf("Enter an Integer scanf("%d", &value4); printf("Enter an Integer scanf("%d", &value5); for value1n"); for value2n"); for value3n"); for value4n"); for value5n"); sum = value1 + value2 + value3 + value4 + value5; printf("Sum is %dn " , sum ); if (sum >100) printf("Sum is over 100n"); 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
  • 7. 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
  • 8. 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 labon 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. 5 Grading guidelines
  • 9. 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.
  • 10. Document is well-organized, and contains minimal spelling and grammatical errors. Total Points 2 2 2 1 2 1 10 6