Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

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.


Given two boolean values

  1. isGrassTrimmerFound and isWaterHosePipeFound as inputs, create three JS promises using async/await and try/catch blocks. For cutting the grass,
  • resolve with "Grass Trimmed" text, if the isGrassTrimmerFound is true
  • reject with "Grass Trimmer Not Found" text, if the isGrassTrimmerFound is false
  1. For cleaning the garden,
  • resolve with "Garden Cleaned" text
  1. For watering the plants,
  • resolve with "Watered Plants" text, if the isWaterHosePipeFound is true
  • reject with "Water Hose Pipe Not Found" text, if the isWaterHosePipeFound is false

Input

  • The first line of input contains a boolean isGrassTrimmerFound
  • The second line of input contains a boolean isWaterHosePipeFound

Output

  • The output should be a string with the appropriate messages in separate lines

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

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.



LATEST TUTORIALS
APPROVED BY CLIENTS