Помощ със задача за освобождаване по C++
Здравейте. Знам, че за вас тази задача изглежда многоточие лесна и елементарна. С две думи - всеки може да я направи. Но изпитвам затруднение и не мога изобщо да я направя.. Ако можете да помогнете ще се радвам много. Благодаря предварително и ето задачата:
This exercise should familiarise you with functions and parameters. You will have to design and
implement a program that helps a printer in making quotes for their products. There are many ways
to write this program, but it is essential that you use functions and that you do not use any global
variables (you will not even need local variables)
PART 1 (worth 50%): A printer has the following pricing system for books. For black and white
printing, each sheet of paper costs a penny. In addition, they have to make a plate for each page of
the original, costing 7 pounds. For colour printing, each sheet of paper costs 4 pennies, and the
plates are 28 pounds. Binding costs 2 pound per copy of the book. These prices exclude 17.5% VAT
(VAT has not yet risen on this bookbinder's planet). The printing is double sided.
Ценоразписът на една печатарска машина е следният:
– черно-бяло разпечатване – 0.01 лири на ЛИСТ хартия /не страница/ /в моята функция -
double sh;
– печатарска плака за черно-бяло – 7 лири /в моята функция – int pl;/
– цветно принтиране – 0.04 лири /отново double sh, тъй като програмата трябва да
работи с предварително зададени стойности/
– печатарска плака за цветно – 28 лири – /отново int pl поради посочената горе
причина/
– подвързване /няма значение какво принтиране/ - 2 лири – при мен int bin=2
– ДДС – 17,5% - double vat
– принтирането е двустранно
Пример: изработката на 400 черно-бели книги със 100 страници струва:
100*7 pounds £ 700.00 for the plates.
(100/2)*400*1 pennies £ 200.00 for the paper. (2 pages per sheet)
400*2 pounds £ 800.00 for the binding.
Subtotal £ 1700.00
VAT £ 297.50 17.5% over 1700 pounds
Grand Total £ 1997.50
1. Write a function that calculates the price of a job given the number of pages, price per sheet,
price per plate, and number of copies.
2. Write a function that calculates the price of a job given the number of pages and the number
of copies for black and white printing. This function should call the function that you wrote
for part 1.
3. Write a function that calculates the price of a job given the number of pages and the number
of copies for colour printing. This function should call the function that you wrote for part 1.
4. Write a main program that calculates the total price of printing 1000 colour books with 32
pages, 2000 black/white books with 40 pages and 400 black/white books with 160 pages.
The main function should call the functions that you wrote for parts 2 and 3.