How To Essay

458 words - 2 pages

CMIS 102 Hands-On Lab
// Week2
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. It will also divide two float numbers to yield a third float number. Once the calculations are made the results of all the numbers will be printed to the output screen.
We will use sequential programming statements.
We will define 3 integer numbers: a,b,c.
c will ...view middle of the document...

// It will also divide two float numbers to yield a third float number.
// Declare variables
Declare a,b,c as Integer
Declare f as Float
// Set values of Integers
Set a=10
Set b=20
Set c=a+b
// Print c
Print a,b,c
Set f=75.0
Set g=3.0
Set h=f+g
// Print h
print f,g,h

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.
// It will also divide two float numbers to yield a third float number.
// Developer: Faculty CMIS102
// Date: Jan 31, 2014
#include <stdio.h>
int main ()
/* variable definition: */
int a, b, c;
float f, g, h;
/* variable initialization */
a = 10;
b = 20;
c = a + b;
printf("Integers (a,b) and sum (c) are : %d,%d,%d \n", a,b,c);
f = 75.0;
g = 3.0;
h = f/g;
printf("Floats (f,g) and quotient (g) are : %f,%f,%f \n", f,g,h);
return 0;

Results from running the programming at

Learning Exercises for you to try:
1. How would you change all the components if you wanted to output the product of f and g as opposed to the quotient? (Hint: Each step would be changed slightly.)
2. Why do you need %d for printing integers and %f for printing floats? Would the code work properly if you switched those values (e.g. used %f for integers and %d for floats)?
3. What additional test cases could you use to validate your program works?

Other Papers Like How To

How to Jing Essay

519 words - 3 pages Take Your First Capture So you've installed Jing, but now what? Learn how to take your first capture, and we bet you'll get the hang of Jing very quickly. Do you see the sun? It looks like the image below--the faint one without the mouse cursor. It's discreetly tucked away somewhere on the edge of your screen, always ready when you need to make a capture. (Oh, and you can always move or hide the sun if you want.) Take Your First Capture

How to Make Phamplet Essay

3818 words - 16 pages How to Make a Pamphlet in Microsoft Word 2007 By Sam N. Austin, eHow Contributor *   *   *   * Print this article Microsoft Office Word 2007 is designed for office use. Word 2007, therefore, includes a range of templates for office documents such as faxes, letters, memos and calendars. Word 2007 also includes templates for multi-page documents such as reports, brochures and pamphlets. Microsoft designed the templates so

How to Socialize Children

600 words - 3 pages generation, broadly defined as the process in which they compare and learn the behavioral patterns of their ancestors and their contemporaries, plays a role of great significance in the system of education. As the society itself is a network of human relations, the children’s learning how to deal with people, while in the process placing themselves in the society, will naturally brighten the future of the society. Bearing harsh reprimands from

How to Prevent Cheating

2527 words - 11 pages How to Prevent Cheating Preventing Corruption By Margaret Steen WHEN A CORPORATE SCANDAL throws a company into crisis or even destroys it, many onlookers’ reaction is that the people involved must have been immoral. Certainly they, the onlookers, would never become involved in cooking the company books, approving mortgages without proper documentation, or lying to customers about a product’s capabilities. Yet it’s easier than most people

How to Analyse Sources

759 words - 4 pages HOW TO ANALYSE SOURCES ANALYSING OF SOURCES Historical criticism.-> Original document? How, when, and why did it come into being? Where does it come from? Who is the author or the cartoonist or the cameraman? 2 critical questions: Could the witness possibly have known the truth? Did the witness wish to tell the truth? EVALUATING OF SOURCES Authenticity? (are there factual errors in the source

How to Learn English

1150 words - 5 pages How to Learn English Well Improve your English All English learners want to improve their English, but as you know, it can be difficult! For you to learn, you need to work on all areas. The four main areas for you to focus on are: Reading, Writing, Speaking, and Listening. Our English courses promote these 'core skills' because all need to be worked on for you to learn English well. Here are some proven ways to help you learn. Good

How to Smile

1023 words - 5 pages How to Smile John Lennon once said, “Count your age by friends, not years. Count your life by smiles, not tears.” If his saying was true, most people must be two or three hundred years old according to their face-book pages. However, their life must be miserable since I hardly see anyone smile to a strange on a busy street anymore. Smile and be happy are not just a formal act of friendliness, but it’s also a way to experience life. Although no

How To Write Paragraph

555 words - 3 pages HOW to WRITE a PARAGRAPH The practice of writing paragraphs is essential to good writing. Paragraphs help to break up large chunks of text and make the content easier for readers to digest. When writing the paragraph we should plan the paragraph, write the paragraph, and review the paragraph. First, plan the paragraph, must have a clear idea of what the paragraph is going to be about. This is because a paragraph is essentially a

How to Stay Healthy

595 words - 3 pages There are so many reasons how, and why we should stay healthy. Simple things like brushing your teeth in the morning to something more drastic like participating in a marathon. It is very important for us as Americans to maintain a healthy lifestyle and to do so we need to improve our well being not only physically, but also mentally and emotionally. Physical activity is done for different reasons and in different settings. If you think of

How to Communicate Effectively

928 words - 4 pages How to Communicate Effectively With Any Learning Style NAME Foundations of General Education and Professional Success / GEN/200 September 16, 2011 PROFFESSOR’S NAME Abstract In 1938 Howard Gardner a Harvard University professor changed the way intelligence and learning is perceived with his theory of multiple intelligences (Carter, Bishop, & Kravits, 2007). According to Professor Gardner, there are eight different

How to Prevent Polarization

2270 words - 10 pages your study. Briefly tell us why this study should be done. Use the proper referencing techniques! To elaborate on my example: tell us how many people living with AIDS are in need of home-based long-term care. What percentage relies on informal (volunteer) caregivers for help? Tell us if burnout is a problem, etc. In the introduction, you should use evidence (facts, figures, and works by other authors) to convince us that your chosen research

Related Essays

How To Essay

610 words - 3 pages Dylan Anthony 4/11/16 How to Reload .45 Caliber Ammunition When reloading ammunition, you can reload any type of ammunition ranging from a .22 to a .45 caliber bullet. In order to be able to reload your own ammunition, you need a variety of equipment that is very costly in the beginning but will pay off in the long run down the road. Nowadays, the price to make your own is a lot cheaper than a box of bullets from the gun

How To Tell Yourselves Essay

315 words - 2 pages SESSION PLAN |Estimated time to complete this module: | |10 minutes | |Module 7 |HOW TO TELL YOURSELF - IT’S NOT TOO LATE

How To Become Rich Essay

798 words - 4 pages I am a student of business who has studied how people become wealthy throughout the existence of man and one thing I have come down to is this: Becoming wealthy is a state of being and a science. By becoming wealthy you change your character. Anyone can become wealthy, if they have the right amount of discipline, desire, and a way to become rich. I believe if you have enough will and drive, you don’t even need a plan to become rich. As long

How To Motivate Employees Essay

803 words - 4 pages “How to motivate employees” Abstract Positive motivation within an organization today is more important than ever to achieving success. Organizations need to understand the concept of motivation, which comes in a variety of forms such as total rewards, perks or recognition within the corporation. Motivation also leads to higher productivity, greater profits and longevity. It is very for managers to understand how to