Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose: To practice the use of arithmetic expressions. Department of Computer Science 1 7 6 Thorvaldson Building 1 1 0 Science Place, Saskatoon, SK ,

Purpose: To practice the use of arithmetic expressions.
Department of Computer Science
176 Thorvaldson Building
110 Science Place, Saskatoon, SK, S7N 5C9, Canada Telephone: (306)966-4886, Facsimile: (306)966-4884
CMPT 141
Winter 2024 Introduction to Computer Science Question 3(7 points):
The notorious pirate, Tractor Jack, has spent the summer sailing up and down the Saskatchewan River, raiding silos, and stealing tons of wheat, barley and other grains. With winter coming, its time for Tractor Jack to divide up this booty amongst his crew. The accord Tractor Jack has with his crew is that, as captain, he receives 30% of all the booty. The rest is to be divided up amongst his crew in equal shares. Finally, Jack, being a socially responsible pirate, anonymously donates 15% of his own share of the booty to the Saskatoon Food Bank.
Write a program for Tractor Jack that will ask the user to input the total value of booty plundered (in dollars), and the number of crew (not including Tractor Jack himself). Then the program should display the value of Tractor Jacks share of the booty (before his charitable donation), the value of the remaining share to be divided amongst the crew, the value of booty that each crew member receives, and the amount of money Jack donates to the food bank.
You may assume that the user supplies valid input from the console, that is, a positive number for the amount of plunder, and a positive integer for the number of crew.

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

Big Data And Hadoop Fundamentals Tools And Techniques For Data Driven Success

Authors: Mayank Bhushan

2nd Edition

9355516665, 978-9355516664

More Books

Students also viewed these Databases questions