Create a C++ program that will solve the given programming problems below. Problem 1 - File Name: Money.cpp Description: 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 Ali: “if you give me all your money, I will give you double the amount". What Ali doesn’t know is that EpicJohnny42 is a devious scammer. When they trade, EpicJohnny42 will give Ali 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 EpicJohnny42 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 Ali had already accepted the trade, failing to notice the error. Now your task is to determine how much money does Ali lost 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Lab task 2: Programming.
- Create a C++ program that will solve the given programming problems below.
Problem 1 - File Name: Money.cpp
Description:
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 Ali: “if you give me all your money, I
will give you double the amount". What Ali doesn't know is that EpicJohnny42 is a devious
scammer. When they trade, EpicJohnny42 will give Ali 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 EpicJohnny42 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 Ali had already accepted the trade, failing to notice the error. Now your
task is to determine how much money does Ali lost 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 <m<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 Ali lost during the trade in a new line.
Example Output
Ali lost 2802 money
Example Program Execution:
Enter how much money Ali have before the trade: 3502
Ali lost 2802 money.
Transcribed Image Text:Lab task 2: Programming. - Create a C++ program that will solve the given programming problems below. Problem 1 - File Name: Money.cpp Description: 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 Ali: “if you give me all your money, I will give you double the amount". What Ali doesn't know is that EpicJohnny42 is a devious scammer. When they trade, EpicJohnny42 will give Ali 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 EpicJohnny42 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 Ali had already accepted the trade, failing to notice the error. Now your task is to determine how much money does Ali lost 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 <m<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 Ali lost during the trade in a new line. Example Output Ali lost 2802 money Example Program Execution: Enter how much money Ali have before the trade: 3502 Ali lost 2802 money.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY