Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how, vor ation's loto Hing et Tha pa CSCI 14-02 Lab Assignment 2 15 Points, Due 2/12/19 Basic Arithmetic Calculations This Lab Assignment introduces you

image text in transcribed
how, vor ation's loto Hing et Tha pa CSCI 14-02 Lab Assignment 2 15 Points, Due 2/12/19 Basic Arithmetic Calculations This Lab Assignment introduces you to the basic input and output of this programming language. One of the "standard" learning exercises to familiarize yourself with a programming language's syntax and grammar is to code a simple program that: 1. 2. 3. Allows the user to enter two numbers Add, Subtract, Multiply, Divide, Mod (remainder) those two numbers Output the results This covers the three basic sections of any program's logie: Data Input e Calculation of the incoming data and any intermediate calculations . Output We will dispense with any GIGO ("Garbage In, Garbage Out") defenses such as division by zero. Develop your basic logic flow (what must happen first, second, next, etc) Determine the names of the estimated variables that you may need as well as their probable data type 1. 2. 3. 4. Write the code on paper before trying to create a source code file Code each section and test it "one section at a time". Do not go on until the current section "works 5. Develop "intelligent" and useful input prompts to tell the user exactly what to enter or what to do 6. Test the output (it may compile with no errors but if the output is "incorrect, it still is "incorrect 7. Mod is "integer" division for remainders. What considerations would you have to do for the decimal numbers? Example program output: You entered 34.5 and 55.6 - goe 556 34.5+55.6-90.1 34.5-55.6 #-21.1 34.5 X 55.6 1918.2 34.5 / 55.6 = 0.620504 34.5 mod 55.6 remainder 34 55.6 mod 34.5 remainder 21 Hit Any Key to Continue... Display your calculations, showing some "mysterious" value on the output does not help the user understand what that was NOR "help" you debug any potential error (think "what" appears on any "itemized" receipt or invoice from a store) that shows you all of the factors in that calculation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions