In this exercise, you will create a program that adds, subtracts, multiplies, or
divides two integers. The program will need to get a letter (A for addition, S for
subtraction, M for multiplication, or D for division) and two integers from the user. If
the user enters an invalid letter, the program should not ask the user for the two
integers. Instead, it should display an appropriate error message before the program
ends. If the letter is A (or a), the program should calculate and display the sum of
both integers. If the letter is S (or s), the program should display the difference
between both integers. When calculating the difference, always subtract the smaller
number from the larger one. If the letter is M (or m), the program should display the
product of both integers. If the letter is D (or d), the program should divide both
integers, always dividing the larger number by the smaller one .
mohammed.alrasheed.353 0 Newbie Poster
Moschops 683 Practically a Master Poster Featured Poster
mohammed.alrasheed.353 0 Newbie Poster
Moschops 683 Practically a Master Poster Featured Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
CppforSchoolStudents -3 Newbie Poster
happygeek commented: bad form, just dumpong full code in response to a 'gimme teh codez' homework cheat request -3
Assembly Guy 72 Posting Whiz
bradly.spicer 47 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.