Entries by Hannah Wangui

Question Question [WEEK 02 PROBLEM 080712 travel miles] You are driving a car at 68 miles per hour. Prompt for the number of hours, then display how far you will get during that time. Run the program to see the exact format of the output. . Prompt for the number of hours, then display how far you will get during that time. Run the program to see the exact format of the output.

Question [WEEK 02 PROBLEM 080712 travel miles]You are driving a car at 68 miles per hour. Prompt for the number of hours, then display how far you will get during that time. Run the program to see the exact format of the output.   Looking for a Similar Assignment? Order now and Get 10% Discount! […]

 

Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Question Instructions: Question Instructions: Create a single script (.m file) to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Please remember to follow the programming style sheet on ANGEL. When complete, please submit your code to the dropbox on ANGEL; the graders will run it to view your output. Name your file like this: username_lab6.m (example: bjs5332_lab6.m). Your submission must be a single .m file. Problem 1 (10 points) Permanent employees are generally classified under two different compensation schemes: wage payroll (“wage”) employees, and salaried employees. Wage employees receive an hourly rate for the time they work, and are eligible for overtime on the time they work over the specified “fulltime hours”. Salaried employees receive a fixed paycheck regardless of the number of hours worked; as such, they are ineligible for overtime. Consider a company that compensates their wage employees as such: Full-Time Hours: 40 Normal Hourly Rate: $23/hour Overtime Multiplier: 1.5 (for time over 40 hours) Write a program that a payroll clerk could use to figure out the gross pay for their employees. Calculate the pay (printed only to 2 decimal places) for wage employees; include a notification if a wage employee will be receiving overtime pay. Since a salaried employee’s pay is fixed, there would be no reason to need to calculate it – a simple statement stating such to the user observing this fact will suffice. Prompt the user with a menu to choose “Wage Employee” or “Salaried Employee,” then use a switch to examine each of those cases as appropriate. Try to mirror the sample results I’ve included on the second page of this document. Emulate the behavior of a do while loop in MATLAB to ensure the program runs at least once; the program should run until the user enters a sentinel value of −1. Only enter numbers when you check if the program should terminate. Hints: (1) For wage employees, overtime only applies to the time worked over the full-time hours. (2) do while loops are unavailable in MATLAB, but we discussed how to emulate their behavior in Lecture 16 using while loops. (3) Only enter numbers to check if the loop should stop, otherwise the program will yield errors when you check the stopping criteria. (4) You might find it useful to nest an if statement into one of your switch cases. Sottile – Spring 2016 Sample Results: Sample Menu: Sample Run I/O: How many hours did employee work?: 30 Gross pay is $690.00 Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: 5 How many hours did employee work?: 50 Employee will receive overtime Gross pay is $1265.00 Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: 2 Salaried employees don’t enter hours! Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: -1 Goodbye! Note: The selections on the menu needed to generate this output are: Wage Employee, Wage Employee, Salaried Employee ATTACHMENT PREVIEW Download attachment Sottile – Spring 2016 CMPSC 200 Programming for Engineers with MATLAB Lab 6 Instructions: Create a single script (.m file) to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ansto store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Please remember to follow the programming style sheet on ANGEL. When complete, please submit your code to the dropbox on ANGEL; the graders will run it to view your output. Name your file like this: username_lab6.m(example: bjs5332_lab6.m). Your submission must be a single .m file. Problem 1(10 points) Permanent employees are generally classified under two different compensation schemes: wage payroll (“wage”) employees, and salaried employees. Wage employees receive an hourly rate for the time they work, and are eligible for overtime on the time they work over the specified “full-time hours”. Salaried employees receive a fixed paycheck regardless of the number of hours worked; as such, they are ineligible for overtime. Consider a company that compensates their wage employees as such: Full-Time Hours: 40 Normal Hourly Rate: $23/hour Overtime Multiplier: 1.5 (for time over 40 hours) Write a program that a payroll clerk could use to figure out the gross pay for their employees. Calculate the pay (printed only to 2 decimal places) for wage employees; include a notification if a wage employee will be receiving overtime pay. Since a salaried employee’s pay is fixed, there would be no reason to need to calculate it – a simple statement stating such to the user observing this fact will suffice. Prompt the user with a menu to choose “Wage Employee” or “Salaried Employee,” then use a switch to examine each of those cases as appropriate. Try to mirror the sample results I’ve included on the second page of this document. Emulate the behavior of a do whileloop in MATLAB to ensure the program runs at least once; the program should run until the user enters a sentinel value of −1. Only enter numbers when you check if the program should terminate. Hints: (1) For wage employees, overtime only applies to the time worked over the full-time hours. (2) do whileloops are unavailable in MATLAB, but we discussed how to emulate their behavior in Lecture 16 using whileloops. (3) Only enter numbers to check if the loop should stop, otherwise the program will yield errors when you check the stopping criteria. (4) You might find it useful to nest an ifstatement into one of your switch cases. to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Please remember to follow the programming style sheet on ANGEL. When complete, please submit your code to the dropbox on ANGEL; the graders will run it to view your output. Name your file like this: username_lab6.m (example: bjs5332_lab6.m). Your submission must be a single .m file. Problem 1 (10 points) Permanent employees are generally classified under two different compensation schemes: wage payroll (“wage”) employees, and salaried employees. Wage employees receive an hourly rate for the time they work, and are eligible for overtime on the time they work over the specified “fulltime hours”. Salaried employees receive a fixed paycheck regardless of the number of hours worked; as such, they are ineligible for overtime. Consider a company that compensates their wage employees as such: Full-Time Hours: 40 Normal Hourly Rate: $23/hour Overtime Multiplier: 1.5 (for time over 40 hours) Write a program that a payroll clerk could use to figure out the gross pay for their employees. Calculate the pay (printed only to 2 decimal places) for wage employees; include a notification if a wage employee will be receiving overtime pay. Since a salaried employee’s pay is fixed, there would be no reason to need to calculate it – a simple statement stating such to the user observing this fact will suffice. Prompt the user with a menu to choose “Wage Employee” or “Salaried Employee,” then use a switch to examine each of those cases as appropriate. Try to mirror the sample results I’ve included on the second page of this document. Emulate the behavior of a do while loop in MATLAB to ensure the program runs at least once; the program should run until the user enters a sentinel value of −1. Only enter numbers when you check if the program should terminate. Hints: (1) For wage employees, overtime only applies to the time worked over the full-time hours. (2) do while loops are unavailable in MATLAB, but we discussed how to emulate their behavior in Lecture 16 using while loops. (3) Only enter numbers to check if the loop should stop, otherwise the program will yield errors when you check the stopping criteria. (4) You might find it useful to nest an if statement into one of your switch cases. Sottile – Spring 2016 Sample Results: Sample Menu: Sample Run I/O: How many hours did employee work?: 30 Gross pay is $690.00 Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: 5 How many hours did employee work?: 50 Employee will receive overtime Gross pay is $1265.00 Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: 2 Salaried employees don’t enter hours! Do you wish to continue? Enter -1 to terminate, otherwise the program will continue: -1 Goodbye! Note: The selections on the menu needed to generate this output are: Wage Employee, Wage Employee, Salaried Employee ATTACHMENT PREVIEW Download attachment Sottile – Spring 2016 CMPSC 200 Programming for Engineers with MATLAB Lab 6 Instructions: Create a single script (.m file) to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ansto store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Please remember to follow the programming style sheet on ANGEL. When complete, please submit your code to the dropbox on ANGEL; the graders will run it to view your output. Name your file like this: username_lab6.m(example: bjs5332_lab6.m). Your submission must be a single .m file. Problem 1(10 points) Permanent employees are generally classified under two different compensation schemes: wage payroll (“wage”) employees, and salaried employees. Wage employees receive an hourly rate for the time they work, and are eligible for overtime on the time they work over the specified “full-time hours”. Salaried employees receive a fixed paycheck regardless of the number of hours worked; as such, they are ineligible for overtime. Consider a company that compensates their wage employees as such: Full-Time Hours: 40 Normal Hourly Rate: $23/hour Overtime Multiplier: 1.5 (for time over 40 hours) Write a program that a payroll clerk could use to figure out the gross pay for their employees. Calculate the pay (printed only to 2 decimal places) for wage employees; include a notification if a wage employee will be receiving overtime pay. Since a salaried employee’s pay is fixed, there would be no reason to need to calculate it – a simple statement stating such to the user observing this fact will suffice. Prompt the user with a menu to choose “Wage Employee” or “Salaried Employee,” then use a switch to examine each of those cases as appropriate. Try to mirror the sample results I’ve included on the second page of this document. Emulate the behavior of a do whileloop in MATLAB to ensure the program runs at least once; the program should run until the user enters a sentinel value of −1. Only enter numbers when you check if the program should terminate. Hints: (1) For wage employees, overtime only applies to the time worked over the full-time hours. (2) do whileloops are unavailable in MATLAB, but we discussed how to emulate their behavior in Lecture 16 using whileloops. (3) Only enter numbers to check if the loop should stop, otherwise the program will yield errors when you check the stopping criteria. (4) You might find it useful to nest an ifstatement into one of your switch cases.

Question Instructions:Create a single script (.m file) to solve this problem. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. Suppress your output for every calculation or allocation with a semi-colon; you may only use print commands to print output. Please remember to […]

 

Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Question Question Write an if-else statement to describe an object. Print “Balloon” if isBalloon is true and isRed is false. Print “Red balloon” if isBalloon and isRed are both true. Print “Not a balloon” otherwise. End with newline.(Notes) THIS IS IN C++ 1 2 3 4 5 6 7 8 9 10 11 #include usingnamespacestd;intmain(){boolisRed=false;boolisBalloon=false;/* Your solution goes here */return0;} Run Print “Balloon” if isBalloon is true and isRed is false. Print “Red balloon” if isBalloon and isRed are both true. Print “Not a balloon” otherwise. End with newline.(Notes) THIS IS IN C++ 1 2 3 4 5 6 7 8 9 10 11 #include usingnamespacestd;intmain(){boolisRed=false;boolisBalloon=false;/* Your solution goes here */return0;} Run

Question Write an if-else statement to describe an object. Print “Balloon” if isBalloon is true and isRed is false. Print “Red balloon” if isBalloon and isRed are both true. Print “Not a balloon” otherwise. End with newline.(Notes) THIS IS IN C++ 1 2 3 4 5 6 7 8 9 10 11 #include <iostream>usingnamespacestd;intmain(){boolisRed=false;boolisBalloon=false;/* Your […]

 

Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"