Posts

t2

Dollars & Cents Write a C++ program to add two dollars and cents. INPUT & OUTPUT FORMAT: Input consists of 4 integers. First two inputs correspond to the value of the first dollar and cent. Next two inputs correspond to the value of the second dollar and cent. Output should print the sum of dollar and cent. SAMPLE INPUT: 30 10 140 99 SAMPLE OUTPUT: 171 9 Case 1 Case 2 Case 3 Input (stdin) 30 10 140 99 Output (stdout) 171 9 v#include using namespace std; int main() { int d1, c1, d2, c2; std::cin>>d1>>c1>>d2>>c2; int dollar=d1+d2; int cent=c1+c2; while(cent>100) { cent=cent-100; dollar=dollar+1; break; } std::cout

TEST 1

Time sheet Jeevitha just started to work as a programming trainer for UIT's Placement Cell. She is paid Rs.100 an hour, with a few exceptions. She earns an extra Rs.15 an hour for any part of a day where she works for more than 8 hours, and an extra Rs.25 an hour for hours beyond 40 in any one week. Also, she earns a 25% bonus for working on Saturdays and a 50% bonus for working on Sundays. The bonuses for Saturday and Sunday are computed based on the hours worked on those days. And there is no bonus for working more than 40 hours in a week. You'll be given the number of hours Jeevitha worked on each day in a week (Sunday, Monday, ..., Saturday), and you need to compute her salary for the week. INPUT & OUTPUT FORMAT: Input consists of 7 integers less than or equal to 24 on separate lines Print Jeevith's salary for a week. SAMPLE INPUT: 0 8 8 8 10 6 0 SAMPLE OUTPUT: 4030 Case 1 Case 2 Case 3 Input (stdin) 0 8 8 8 10 6 0 Output (stdout) 4030 ...