Yazılım | Programlama C++ ile alakalı sorum

rupsidupsi

Yeni üye
13 Ocak 2018
41
0
Yardım edebilecek var mı?



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 [FONT=&quot]functions[/FONT] and that you do [FONT=&quot]not[/FONT] 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 - [FONT=&quot]£ 700.00 for the plates[/FONT]
[FONT=&quot][FONT=&quot](100/2)*400*1 pennies - [/FONT][/FONT][FONT=&quot]£ 200.00 for the papers (2 papers per sheet)[/FONT]
400*2 pounds - [FONT=&quot]£ 800.00 for the binding[/FONT]
[FONT=&quot] Subtotal - [/FONT][FONT=&quot][FONT=&quot]£[/FONT] 1700.00[/FONT]
VAT - [FONT=&quot]£ 297.50 17.5 over 1700.00 pounds[/FONT]

[FONT=&quot] Grand Total - [/FONT][FONT=&quot]£ 1997.50[/FONT]


[FONT=&quot]1. [/FONT]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.
[FONT=&quot]2. [/FONT]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.
[FONT=&quot]3. [/FONT]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.
[FONT=&quot]4. [/FONT]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.

PART 2 (worth 50%):
[FONT=&quot]1. [/FONT]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 signatures.
• The price of printing 35 black and white books of 34 pages each with 16-fold signatures.


Please note: You don't need to change the parameters of your functions for this part. Each [FONT=&quot]printed page[/FONT] (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 [FONT=&quot]%[/FONT], for example [FONT=&quot]a % b[/FONT] 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. [FONT=&quot](int) 3.14159[/FONT] will evaluate to exactly 3.


[FONT=&quot]2. [/FONT]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 [FONT=&quot]n[/FONT], where [FONT=&quot]n[/FONT] 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 signatures.
• The price of printing 100 black and white books of 34 pages each with 6 fold signatures.

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).


[FONT=&quot]
[/FONT]


[FONT=&quot]
[/FONT]
 
Moderatör tarafında düzenlendi:
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.