Friday, 12 September, 2025г.
russian english deutsch french spanish portuguese czech greek georgian chinese japanese korean indonesian turkish thai uzbek

пример: покупка автомобиля в Запорожье

 

progfest2013problemset pdf Google Chrome 12 13 2017 8 52 32 PM

progfest2013problemset pdf   Google Chrome 12 13 2017 8 52 32 PMУ вашего броузера проблема в совместимости с HTML5
Ariana, Joseph, Abraham and Kenneth's CS1 final 2017 CALIFORNIA STATE UNIVERSITY, LOS ANGELES PROGFEST 2013 Problem 3 Calculating Wages Problem You work for a company that operates 24‐ hours a day, 7 days a week, and pays its employees every two weeks. The company hands you a file with all of the current employee’s time information. The format of this document is as follows: This function prompts employee to enter their name and stores their name in the private variable called name. void Employee::readEmpName() { cout "Name: "; getline(cin,name); } This function prompts user to input the day they worked, the time they clocked in and out, and how much they got paid an hour. void Employee:: readEmpInfo() { cout "Day: "; getline(cin,day); cout "Clock in: "; cin inHour; cin inMin; cout "Clock out: "; cin outHour; cin outMin; cout "Salary: "; cin salary; } This Boolean function asks users if they want to add a day to week one. If user inputs y then Boolean returns true. bool Employee::addDay(Employee x) { cout "ADD MORE DAYS TO WEEK 1: (y/n) " endl ; getline(cin,confirm); if (confirm == "y") return true; } This function calculates the time worked by employee. We first calculated the hours the employee worked by subtracting the time they clocked out with the time they clocked in and stored this value in a variable called hours. Then we calculated the minutes worked by the employee by subtracting time out with the time in and stored this value in the variable called minutes. If minutes is less than zero then we subtract an hour from the variable hours and to calculate the minutes we subtract 60 from the absolute value of minutes, we used the absolute function hence why we included the cmath library in our header files. We also convert minutes to hours so that we can calculate how much the employee earned working those minutes. void Employee::empHours() { hours = outHour - inHour; minutes = outMin - inMin; if (minutes 0) { hours = hours - 1; minutes = 60 - abs(minutes); } cout "You worked " hours " hours and " minutes " minutes " endl ; minutes = minutes /60; // need to convert minutes to hour to calculate how much will be earned for those min worked } This function is used to calculate how much was earned in one day. To calculate how much was earned for the total hours worked, we multiplied the value stored in the variable called hours and the value stored in the variable salary. The variable payMin stores the amount employee earned working from minutes. Because we converted minutes to hours we can multiply the value stored in minutes with the value stored in the variable salary. Then we added the variable payhour with payMin to combine what the amount the employee earned for the hours and minutes he/she worked. void Employee::empPayDay() { payHour = hours * salary; payMin = minutes * salary; dayPay = payHour + payMin; cout endl "You made $ " dayPay endl; } void Employee::printEmpInfo() const { cout name " " day " " inHour inMin " " outHour outMin " " salary; }
Мой аккаунт