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
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...
MATHEMATICS 1. The measure of location which is the most likely to be influenced by extreme...
MATHEMATICS 1. The measure of location which is the most likely to be influenced by extreme values in the data set is the a. range b. median c. mode d. mean 2. If two events are independent, then a. they must be mutually exclusive b. the sum of their probabilities must be equal to one c. their intersection must be zero d. None of these alternatives is correct. any value between 0 to 1 3. Two events, A and B,...
Bivariate Data & Probability After completing the calculation by hand in Q1 you can use Excel...
Bivariate Data & Probability After completing the calculation by hand in Q1 you can use Excel to check your answers before submitting. Q2 assesses your general understanding of probability and linear associations using Excel to analyse a large dataset. Question 1       Covariance and Correlation The table below shows a set of sample bivariate data. Calculate the covariance and correlation coefficient by completing the below table. Show all working. X Y (X - ) (Y - ) (X - )(Y -...
Use the Manufacturing database from “Excel Databases.xls” on Blackboard. Use Excel to develop a multiple regression...
Use the Manufacturing database from “Excel Databases.xls” on Blackboard. Use Excel to develop a multiple regression model to predict Cost of Materials by Number of Employees, New Capital Expenditures, Value Added by Manufacture, and End-of-Year Inventories. Locate the observed value that is in Industrial Group 12 and has 7 employees. Based on the model and the multiple regression output, what is the corresponding residual of this observation? Write your answer as a number, round to 2 decimal places. SIC Code...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT