Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ 4: Little siblings' dividing program Your younger brother and sister are currently learning division in school. Since they keep asking you for help

Using C++ image text in transcribed
4: Little siblings' dividing program Your younger brother and sister are currently learning division in school. Since they keep asking you for help on their homework, you have decided to write a computer program that can help them to check their homework. Your younger brother is currently in grade school. He needs to divide whole numbers and know the result and the remainder of the division. Your sister is in the next grade up. She also needs t numbers, but her teacher wants her to report real-number output with four decimal places. It is now your job to write one program that will read in two numbers and give the output for both of your siblings. (goal: whole number division, remainder, and decimal division, conversion between integer and float data types) Following is an example of the program design process you should go through o divide wholke Use integer variables for the dividend and divisor, and for brother's result and remainder. (You'll also need a float or a double for sister's results.) Program design: . input variables: integer variables for dividend and divisor result/output variables: o for brother: integer variables for quotient and remainder o for sister: floating point (use doubles) for quotient Q: what do you need to do to force C++ to do floating point arithmetic if divisor and dividend are integers?. Program flow: 1. prompt for input values 2. calculate and output brother's math problem (dividend, divisor, quotient, remainder) 3. calculate and output sister's math problem (dividend, divisor, quotient Additional requirements: Name your program grade_school math.cpp Please include your names in a comment. Please indent your program properly. Once you get that working, add the following: Divisions by zero are a bad thing.Add an extra if statement to catch the error if they enter a zero as the divisor Hint:- is not the same as See "Comparison Operators" on p. 48, and especially "Pitfall: Using instead of..." on p. 59 3.1

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

Students also viewed these Databases questions