Question
Develop an algorithm that will ask the user how many courses they are taking this term, allows the user to enter in the number of
Develop an algorithm that will ask the user how many courses they are taking this term, allows the user to enter in the number of credit hours and grade (on a 4.0 scale) for each course, and outputs the GPA for that term. 1) Create a MATLAB script file that: a. Asks a user how many courses they are taking. Assume the user will enter in information for at least 1 course. b. Uses a loop to allow the user to input the number of credit hours and grade for each course, one at a time. Assume the user will enter valid numbers. C. Calculates the weighted GPA and outputs this GPA to the command window. d. Create a sample run using the following data: Course Credit hour Grade 1 3 4.0 2 3 3.3 3 1 2.7 4 3 3.7 5 4 2.0 Test example (not to be submitted): course 1: 4 cr hr, grade: 3.3 pts course 2: 2 cr hr, grade: 2.3 pts. The gpa is 2.9667
8.2]
The gpa is calculated as total gpa points divided by total credit hours. For the test example, this would be: (4*3.3 + 2*2.3)/(4+2). Problem 2 of 2: A wholesale company has offered you a lot of pearls. All of the pearls are of the same gem quality grade. Pearls are separated by diameter. In general, the larger the diameter, the more valuable a pearl is worth. Create a MATLAB program that will take a vector of pearl diameters as well as the asking price by the wholesale company, and create a detailed summary of the lot, complete with count and total price for each category of pearl. You will also determine the total potential income and total profit 1) Your MATLAB script file should a. Take user input for the asking price for the lot of pearls by the wholesale company in US dollars. b. Take user input for each pearl's diameter in the lot as a vector. The user can enter in any number of pearl diameters within the vector. Assume diameters entered will be greater than 0 mm. C. Use a loop to determine the number of pearls that fall within each size category.
d. Determine the total possible retail income for each size category. e. Determine the total possible income that would result from selling the entire lot of pearls at retail price. f. Determine the total possible profit for the lot (calculated as total possible income minus asking price for the lot by the wholesale company) g. Output a detailed invoice including the number of pearls in each size category, the total possible retail income for each size category, the total possible income from the entire lot, and the total possible profit from the lot. Values should be output using whole numbers. h. Use the following size categories for pearls: Size Category Retail Income ($/pearl) Pearl Diameter (mm) Jumbo 1000 15 diameter Extra Large 700 12 =>=>=>=>
plz using matlab when you make the code for me
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started