Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

swork a ru Date: 04 DS 7 One of the jobs that Joe Roberts has been given at work

ID: 3871674 • Letter: S

Question


swork a ru Date: 04 DS 7 One of the jobs that Joe Roberts has been given at work is to order special paper for a report for a board meeting. The paper comes in reams of 500 sheets. He always makes five more copies than the number of people that will be there. Joe wants to know how many reams of paper he needs for-a meeting. He can order only whole, not partial, reams. Assume the required number of pages will not equal an exact number of reams. Test your solution with the following data: The report is 140 pages long. There will be 25 people at the meeting. A Defining diagram Output nput Processing Pint reans B Solution algorithm

Explanation / Answer

I implemented this using c++ you can compile using command
g++ filename.cc
===============================
Output

Enter number of people attending the meeting: 25
Enter number of pages in a rim: 500
Enter number of papers in report: 140
Number of rims required: 9
================================
Code
==================================

#include <iostream>

int main(int argc, char const *argv[])
{
   unsigned int number_of_people = 0, number_of_papers_in_rim = 0, number_of_papers_in_report = 0 ;
   std::cout << "Enter number of people attending the meeting: ";
   std::cin >> number_of_people;
   std::cout << "Enter number of pages in a rim: ";
   std::cin >> number_of_papers_in_rim;
   std::cout << "Enter number of papers in report: ";
   std::cin >> number_of_papers_in_report;

   unsigned int additional_reports = 5;
   unsigned int total_number_of_papers_required =
                   (number_of_people + additional_reports) * number_of_papers_in_report;
   unsigned int number_of_rims_required = total_number_of_papers_required / number_of_papers_in_rim;
   if(total_number_of_papers_required % number_of_papers_in_rim)
       number_of_rims_required++;
   std::cout << "Number of rims required: " << number_of_rims_required << std::endl;
   return 0;
}