ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN112 Homeworks 2013-2015 > задача:


50345 - Orders

CEN112 Homeworks 2013-2015

Старт: 15.дек.2013 в 12:00:00
Финиш: 15.дек.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 50530 - Sum of Ratios
• 50375 - Area of Circles
• 50388 - Number of Armstrong Num...
• 50393 - Palindromic Numbers
• 50339 - The Largest Rectangle
• 50345 - Orders
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 12-Spr1-40. 50327 - Parallel Lines
• 13-Fall2-20. 50395 - Page "Like" Av...
• 14-Spr1-30. 50492 - Contest Score...
• 14-Spr1-40. 50538 - Sum of kth Dia...
• 14-Spr1-60. 50647 - Спираль
• 14-Spr2-20. 50442 - Polynomial Add...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Orders

Write a program that has a class called Order that a restaurant might use to represent orders from customers. Every order item includes three data members

  • Ordered object ID: an integer less than 1000,
  • Number of items ordered: an integer less than 30
  • and a price per item : a floating point number
Your class should have proper constructors that initialize data members. Provide also an overloaded input stream operator to get information and a method called totalAmount() where the total amount returns (the number of items) * (price per item).

Question: Using the given class above, write a program that reads information for n items ordered and calculates and shows the total amount from the order.

Input specification
You will be given an integer (n) the number of items ordered. Then, in each of the following n lines you will be given three integers: Ordered object ID, number of items ordered and a price per item where 1 ≤ n ≤ 100.

Output specification
Show the total amount of the orders.

Sample Input
3
1 5 40
2 3 70
7 3 50
Sample Output
560

Explanation: There are 5 items bought from 40 leke (200), 3 items bought from 70 leke (210) and 3 items from 50 leke (150). The total is 560 leke.


Для отправки решений необходимо выполнить вход.

www.contester.ru