05 Jun umuc cmis102 assignment 2
Question
Assignment 2
CMIS 102 Hands-On Lab
Week 2 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 integer numbers to yield a third integer number. Once the calculations are made the results of all the numbers will be printed to the output screen.
Analysis
We will use sequential programming statements. We will define 3 integer numbers: a, b, c. c will store the sum of a and b.
Test Plan
To understand this program the following input numbers could be used for testing:
a = 10 b = 20 c = a + b = 10 + 20 = 30
In table format the following results are expected:
Run # Input a Input b Expected Output 1 10 20 30 2 0 0 0 3 124 356 480 4 -30 -90 -120
Design using Pseudocode
// This program will sum two integer numbers to yield a third integer number. // It will also divide two float numbers to yield a third float number.
// Declare variables Declare a,b,c as Integer
// Set values of Integers Set a=10 Set b=20 Set c= a + b
// Print a, b, c Print a,b,c
2
C Code
The following is the C Code that will compile in execute in the online compilers.
// C code // This program will sum two integer numbers to yield a third integer number. // Developer: Faculty CMIS102 // Date: Jan 31, XXXX
#include <stdio.h> int main () { /* variable definition: */ int a, b, c;
/* variable initialization */ a = 10; b = 20; c = a + b; printf(“Integers (a,b) and sum (c) are : %d,%d,%d \n”, a,b,c); return 0; }
Results from running the programming at ideone.com:
3
Learning Exercises for you to complete
1. Change the C code to calculate the product of two integers as opposed to the sum of two integers. Then run the new code. Support your experimentation with a screen capture of the code and a screen capture of the successful execution of the new code.
2. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the product of two integers. Include screen shots of the executions of all text table values working properly.
3. Change the C code to calculate the quotient (e.g. a/b) of two floats (e.g. 2.3/1.5).Hint: Use float variable types as opposed to integers. What happens if the denominator is 0.0? Support your experimentation with screen captures 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 quotient of two floats.
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.
Also, provide the answers, associated screen captures, C Code and descriptions of your successful completion of learning exercises 1, 2, 3 and 4.
The answers to the learning exercises, screen captures, C code and descriptions can be included in the same neatly organized document you prepared as you ran this lab. Note the code can be embedded in the word document. However; be sure all code compiles and runs perfectly before submitting the document.
Submit your document no later than the due date listed in the syllabus or calendar.
4
Grading guidelines
Submission Points Successfully demonstrates execution of this lab with online compiler. Includes a screen capture of the code and the output from successful runs. 3 Successfully modifies the code to calculate the product of two integers. 2 Provides a new test table with at least 3 distinct test cases listing input and expected output for the product of two integers. 1 Modifies the code to calculate the quotient of two floats. Describes what happens if the denominator is 0.0? Support your experimentation with screen captures of executing the new code. 2
Provides a new test table with at least 3 distinct test cases listing input and expected output for the quotient of two floats.
1
Document is well-organized, and contains minimal spelling and grammatical errors.
1
Total 10
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
