Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using C++ Lab 02. Variables, datatypes and Op. s X Home Insert View Review Pen Ordinary Ink - T Ali loves to play Massive Multiplayer

image text in transcribed using C++
Lab 02. Variables, datatypes and Op. s X Home Insert View Review Pen Ordinary Ink - T Ali loves to play Massive Multiplayer Online Role playing Game (MMORPG), and he is very excited! The game uses a coin-based money system that can be acquired through playing in combat mode. After spending a long time playing in the combat mode to earn money, Ali meet a very generous user, EpicJohnny42. He made an offer to Alcif you give me all your money. I will give you double the amount". What All doesn't know is that Epic Johnny42 is a devious scammer. When they trade, Epicjohnny42 will give All double the amount, except he will "forget to put the last digit For example: if Ali gave 9874 gold he should receive 19,748, but since Epic Johnny42 is a scammer he will give him 1,974 gold removing the last digit (8) instead of 19,748. Unfortunately, while you were reading this problem All had already accepted the trade failing to notice the error. Now your task is to determine how much money does Alilost during the trade Hint: To remove the last digit of an integer number. The number should be divided by 10 Example: 19748/10 the result is 1974 input Format: Your program should accept an integer value m where (10 sm s 10,000), representing how much money Ali had before the trade Example Input Enter how much money Ali have before the trade: 3502 Output Format: Your program should display the amount of money All lost during the trade in a new line. Example Output All lost 2802 money Example Program Execution: 51P: 10911-120 Fundamentals of Programming COLLEGE OF COMPUTER SCIENCES ERFORSLATION TECHNOLOGY K YALAL UNIVERY, AL ARABIA Enter how much money have before the trade? All lost 2882 noney. Note: Use the input from the given screenshot above to test your program it is

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago