Така това е задачата която моят доцент по "базово програмиране ни е дала за освобождаване от изпит. Но понеже още не съм навлязал в програмирането ми е нужна помощ за направата и, затова ще ви бъда благодарен за всяко едно мнение по темата отностно решаването и. Дала е описанието на задачата на английски език, незнам защо но така е решила. И понеже нямам познат който да е толкова запознат с тази специалност се обръщам към вас за помощ. Нужно ми е да се представя добре зимния семестър защото имам голямо желание лятото да замина на бригада в САЩ, а ако сега покажа характер лятото ще се съгласят да изтегля изпитите си по рано.. И така ето условието на задачата:
Първа задача английски текст
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.
As an example, printing 400 black and white books with 100 pages each costs:
100*7 pounds £ 700.00 for the plates.
pennies £ 200.00 for the paper. (2 pages per
400*2 pounds £ 800.00 for the binding.
Subtotal £ 1700.0
VAT £ 297.50 17.5% over 1700 pounds
Grand Total £ 1997.5
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
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
1. Change the function that calculates the price of a job so that it assumes that books
are printed with 16-fold signatures. (ie, the number of sheets is rounded up to the
nearest multiple of 16).
Change the main function so that it prints in addition to the previous number:
• The price of printing 50 colour books of 30 pages each with 16-fold
• The price of printing 35 black and white books of 34 pages each with 16-fold
Please note: You don't need to change the parameters of your functions for this part. Each
printed page (including partially printed pages) will need a plate, but blank pages won't.
You may print out the first answer using a 16 fold signature as well for this part. Three
numbers should therefore be printed for this extension.
You may wish to find out how to obtain remainders in C using the modulus operator %, for
example a % b in C will give the integer remainder when a is divided by b. You may also
want to look at 'typecasting' - forcing conversion from one type into another type - because
it is a common technique used for rounding in C. For example, typecasting a non-whole
number as an integer will round it down to the nearest integer, e.g. (int) 3.14159 will
2. Change the functions so that the number of pages in a signature is passed as a
parameter. (ie, the number of sheets is rounded up to the nearest multiple of n,
where n is the size of the signature)
Change the main function so that it prints in addition to the previous three numbers:
• The price of printing 35 black and white books of 34 pages each with 8 fold
• The price of printing 100 black and white books of 34 pages each with 6 fold
Please note: For this extension you must print 5 numbers (the original [under a 16 fold
signature], two for the first extension, two for this second extension).
This coursework is to be completed during week 3, to be submitted by Tuesday week 4.