Question

Do the flowchart of that program name = input('Enter the name: ','s'); n=input('\n Enter number of...

Do the flowchart of that program

name = input('Enter the name: ','s');

n=input('\n Enter number of rented cars: ');

m=input('\n Enter car type \n1:SEDAN 2:SUV ');

nm = input('\n Enter number of miles travelled: ');

d = input('\n Enter number of days: ');

if m==1

if (1<=d)&&(d<=6)&&nm<=80

tpay_sed = 79*n*d;

elseif (1<=d)&&(d<=6)&&nm>80

em=nm-80;

tpay_sed = 79*n*d + 0.69*em*n;

end

if (7<=d)&&(d<=29)&&nm<=100

tpay_sed = 69*n*d;

elseif (7<=d)&&(d<=29)&&nm>100

em=n-100;

tpay_sed = 69*n*d + 0.59*em*n;

end

if (30<=d)&&nm<=120

tpay_sed = 59*n*d;

elseif (30<=d)&&nm>120

em=nm-120;

tpay_sed = 59*n*d + 0.49*em*n;

end

fprintf('\n%s(SEDAN)\nNo of Days:%d\nExtra Miles:%d\nTotal Pay:%f\n',name,d,em,tpay_sed);

end

if m==2

if (1<=d)&&(d<=6)&&nm<=80

tpay_suv = 84*n*d;

elseif (1<=d)&&(d<=6)&&nm>80

em=nm-80;

tpay_suv = 84*n*d + 0.74*em*n;

end

if (7<=d)&&(d<=29)&&nm<=100

tpay_suv = 74*n*d;

elseif (7<=d)&&(d<=29)&&nm>100

em=nm-100;

tpay_suv = 74*n*d + 0.64*em*n;

end

if (30<=d)&&nm<=120

tpay_suv = 64*n*d;

elseif (30<=d)&&nm>120

em=nm-120;

tpay_suv = 64*n*d + 0.54*em*n;

end

fprintf('\n%s(SUV)\nNo of Days:%d\nExtra Miles:%d\nTotal Pay:%f\n',name,d,em,tpay_suv);

end

Homework Answers

Answer #1

if you have any doubt please comment below

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. The following resting data were collected from three different sports teams (hockey, rugby and football)....
1. The following resting data were collected from three different sports teams (hockey, rugby and football). Ignoring the sport played, run a Kolmogorov–Smirnov test on the age variable. What is the correct expression for the result? ID Sport Age (y) Body mass (kg) Stature (m) Resting heart rate (bpm) Resting systolic blood pressure (mmHg) Resting diastolic blood pressure (mmHg) Resting mean arterial pressure (mmHg) 1 Hockey 18 79 1.83 65 121 79 93 2 Hockey 20 79.9 1.78 50 127...
You are to write a program to produce an inventory report for a local company. Your...
You are to write a program to produce an inventory report for a local company. Your input will be item name, item number, quantity, price per item, safe stock value. The following shows which columns the input will be in: item name item number quantity price safe stock 20 chars 5 char 3 char 6 chars 3 chars Output will be as follows: item number item name quantity   price   price*quantity   %ofStock flag You will put a symbol in the flag...
16. The following resting data were collected from three different sports teams (hockey, rugby and football)....
16. The following resting data were collected from three different sports teams (hockey, rugby and football). Ignoring the sport played, run a Kolmogorov–Smirnov test on the age variable. What is the correct expression for the result? ID Sport Age (y) Body mass (kg) Stature (m) Resting heart rate (bpm) Resting systolic blood pressure (mmHg) Resting diastolic blood pressure (mmHg) Resting mean arterial pressure (mmHg) 1 Hockey 18 79 1.83 65 121 79 93 2 Hockey 20 79.9 1.78 50 127...
And need to be writing in C++ language Programm need to start with   #include<fstream> Prepare a...
And need to be writing in C++ language Programm need to start with   #include<fstream> Prepare a text file data_in.txt with the following information (highlight the piece of text below with numbers and copy it to a text file): 54, 70, 75, 63, 17, 59, 87, 16, 93, 81, 60, 67, 90, 53, 88, 9, 61, 8, 96, 98, 12, 34, 66, 76, 38, 55, 58, 27, 92, 45, 41, 4, 20, 22, 69, 77, 86, 35, 19, 32, 49, 15,...
Implement the following functions in the given code: def random_suit_number(): def get_card_suit_string_from_number(n): def random_value_number(): def get_card_value_string_from_number(n):...
Implement the following functions in the given code: def random_suit_number(): def get_card_suit_string_from_number(n): def random_value_number(): def get_card_value_string_from_number(n): def is_leap_year(year): def get_letter_grade_version_1(x): def get_letter_grade_version_2(x): def get_letter_grade_version_3(x): Pay careful attention to the three different versions of the number-grade-to-letter-grade functions. Their behaviors are subtly different. Use the function descriptions provided in the code to replace the pass keyword with the necessary code. Remember: Parameters contain values that are passed in by the caller. You will need to make use of the parameters that each...
please write the code in java so it can run on jGRASP import java.util.Scanner; 2 import...
please write the code in java so it can run on jGRASP import java.util.Scanner; 2 import java.io.*; //This imports input and output (io) classes that we use 3 //to read and write to files. The * is the wildcard that will 4 //make all of the io classes available if I need them 5 //It saves me from having to import each io class separately. 6 /** 7 This program reads numbers from a file, calculates the 8 mean (average)...
Your company has been granted an exclusive license to sell ice cream. No one has ever...
Your company has been granted an exclusive license to sell ice cream. No one has ever sold ice cream here before, so you have no idea what the demand will look like. You suspect that people like to buy more ice cream on hotter days, but you are very unsure about what price you should charge to maximize your profit. Over your first season selling ice cream, you vary your price each week for the 10 weeks your license allows...
Your company has been granted an exclusive license to sell ice cream. No one has ever...
Your company has been granted an exclusive license to sell ice cream. No one has ever sold ice cream here before, so you have no idea what the demand will look like. You suspect that people like to buy more ice cream on hotter days, but you are very unsure about what price you should charge to maximize your profit. Over your first season selling ice cream, you vary your price each week for the 10 weeks your license allows...
Historically, the MBA program at Whatsamattu U. has about 40% of their students choose a Leadership...
Historically, the MBA program at Whatsamattu U. has about 40% of their students choose a Leadership major, 30% choose a Finance major, 20% choose a Marketing major, and 10% choose no major. Does the most recent class of 200 MBA students fit that same pattern or has there been a shift in the choice of majors. Using the sample of 200 students (in the data file), conduct a Chi Square Goodness of Fit test to determine if the current distribution...
I completed everything except for the last part. I know my answers are right because i...
I completed everything except for the last part. I know my answers are right because i double checked but i just dont know how to answer the last section. Problem 3-1 Schedule C (LO 3.1) Scott Butterfield is self-employed as a CPA. He uses the cash method of accounting, and his Social Security number is 644-47-7833. His principal business code is 541211. Scott's CPA practice is located at 678 Third Street, Riverside, CA 92860. Scott’s income statement for the year...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT