Given two boolean values
Sample Input 1
true
true
Sample Output 1
Grass Trimmed
Garden Cleaned
Watered Plants
(Sales Commissions) Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of
their gross sales for that week. For example, a salesperson who grosses $3,000 in sales in a week receives $200 plus 9% of $3,000, or a total of $470. Write a C program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson’s salary is truncated to an integer amount):
a) $200–299
b) $300–399
c) $400–499
d) $500–599
We want to store the information of different vehicles. Create a class named Vehicle with two data member named mileage and price. Create its two subclasses
*Car with data members to store ownership cost, warranty (by years), seating capacity and fuel type (diesel or petrol).
*Bike with data members to store the number of cylinders, number of gears, cooling type (air, liquid or oil).
Write a python script that get Room No, Room Rent per day, Number of days stayed in and extra charges (breakfast, lunch, and dinner) and display total bill to customer.
Consider the following instance of load balancing problem. There are m machines and n=2m+1 jobs, 3 jobs are of length m and 2 jobs of m+i for each 1<= i <= m-1. Show that on this instance the list-scheduling algorithm with the LPT rule achieves the approximation ratio 4/3-1/3m.
(fourth part)
You should read the data using this pattern:
Read the first line of data from the vacation.txt file (the miles traveled and the time in
minutes).
while (! inStream.fail() )
// Use here your name for the input file stream.
{
Compute the average speed for this part of the trip. Do so by calling your FindAverage
function.
Print to the report.txt file the numbers just read in as well as the average speed on this
leg of the trip.
Read the next line of data from the vacation.txt file.
}
(third part)
Open both file streams in main and pass them as parameters (must be a reference) to
a function that does all of the reading of the input, the calculations (using
FindAverage), and the writing of output. Thus your program will have 2 functions
other than main.
Your program should not specify where the data files are located. Rather, use the
default location (which is where your .cpp file is located).
When opening a file, always check to see if the open failed. If so, print an
appropriate error message and exit from the program.
Note that you will have to have both the input and output files open for much of this
program.
(Second part)
The report.txt file that your program produces should contain all of the original data, but
at the end of each line, it should show the average speed of the car, in miles per hour, on
that part of the trip. The three numbers on each line should be separated by spaces.
Format the numbers so that they all show exactly 1 decimal place. For the above
vacation.txt file, the corresponding report.txt file should look approximately like this:
5.3 5.5 57.8
12.0 10.5 68.6
52.5 61.0 51.6
Overall average speed: 54.4
Note that all of the numbers are displayed with one decimal place.
Write a FindAverage function that takes the distance in miles and time in minutes
and returns in the function name the average speed in miles per hour. Call this
function each time you need to compute an average speed.
By overall average speed, we mean the total distance (in miles) divided by the total
time (in hours). All of the answers, then, are in miles per hour.