Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Purpose This lab will help you learn the basics of creating and running simple programs

Purpose This lab will help you learn the basics of creating and running simple programs

Computer Science

Purpose

This lab will help you learn the basics of creating and running simple programs. These simple calculators can be created for any equation or process you want to do repeatedly in the future. After completing this assignment, you should be able to write simple programs in Matlab.

Task

Solve each of the following problems by writing and running a Matlab script. You can use this VERY HELPFUL WORKSHEET: Introduction to MATLAB.pdf

  1. Archaeology Unit Conversion
    1. You are a structural engineer working with archaeologists to recreate some ancient Roman structures from plans that have recently been discovered. The measurements are mostly described in units of ancient Roman cubits. In this case, 1 ancient Roman cubit = 0.444 m. Create a thoroughly-commented Matlab program that will take a user-entered measurement in ancient Roman cubits and convert it to SI units (m), and also convert it to another unit still used in the United States (ft) for your partners there who are unfamiliar with international standards. Your program should:
      1. Request a user input for a measurement in ancient Roman cubits
      2. Calculate the measurement in meters
      3. Calculate the measurement in feet
      4. Output the results in the command window, along with descriptions so that the users know what they are seeing
    2. Create a sample run for a measurement of 45 ancient Roman cubits 
  2. Metal Sculpture Price Calculation
    1. You are developing an art project using hemispherical copper pieces, which you will electroplate with gold and hang from ceilings in various arrangements. Create a Matlab program that will take a user entered diameter for a hemisphere, and output the final weight and cost of the piece to help you explore design possibilities. Your program should:
      1. Request a user input for the diameter of the hemisphere (m)
      2. Calculate the volume and surface area of the hemisphere. Both surfaces of the hemisphere (outer curve and flat bottom) will be plated (if you don't know these formulas, Google is your friend!) (If you have trouble visualizing a hemisphere, see this. (Links to an external site.)
      3. Calculate the mass of copper in the hemisphere. The copper you will use has a density of 8960 kg/m3.
      4. Calculate the mass of gold added by plating the entire hemisphere. Assume your process uses 0.0185 kg/m2, regardless of geometry.
      5. Calculate the total mass of the hemisphere
      6. Calculate the cost of materials for the hemisphere. Your supplier provides copper at $6.41 per kg, and gold at $61300 per kg.
      7. Output the cost and mass of the hemisphere, with units and descriptions
    2. Create a sample run for a hemisphere of diameter 0.22 m
  3. GPACalculator
    1. You want to calculate your grade point average (GPA). Create a Matlab program that will take credit hours and grades for each course and calculate your GPA for that semester. Assume that you will always have four courses each semester. Note you can do this simply with the "input" and "display" commands. Your program should:
      1. Request the user input the number of credit hours for a first course, immediately followed by the number of grade points earned for that course. Assume that grade point A = 4, B = 3 and so on. Assume no +/ - grades exist (i.e., no A- or A+)
      2. Request credit hours and grade points for a second, third, and fourth course
      3. Calculate your GPA, using the following formula: summation of the product of the semester hours and number of points earned divided by the summation of semester hours.
      4. Display your semester GPA with descriptive text
    2. Create a sample run for a student getting an A in a 2 credit course, B in a 4 credit course, C in a 2 credit course, and B in a 3 credit course.  The sample run should show both your input and the output.  

Deliverables

  • .m files for each problem with appropriate file names (3 m-files in total)
    • File name convention: YourPID_C1_P1.m, YourPID_C1_P2.m, YourPID_C1_P3.m (replace YourPID with your PID, e.g. bdcham_C1_P1.m)
  • A single .pdf file with an appropriate file name, containing:
    • Your name, class section, etc.
    • For each problem:
      • The listing of your code (copy and paste your script into your word processor with the source formatting)
      • A screen capture of a sample run with the requested values, showing command window and workspace. This must be legible.
    • File name convention: YourPID_C1.pdf

Primary Grading Criteria

Hints and Resources

  • Using ‘disp’ on one line to describe units and again to output values for a variable is an easy way to make a user understand results.
  • Commenting and programming are both easier if you write comments first. Write a comment for each step explaining what you want that step to do. Once those comments are written, add in the code.
  • The “Snipping Tool” or “Snip & Sketch” (use your windows search bar to find it) are great ways to create readable screenshots.
  • You can find additional help with the Matlab help, or online
  • Additional support and tutorials are available through the First Year Digital Resources Canvas site. If you do not have access for some reason, please email your instructor. 

Option 1

Low Cost Option
Download this past answer in few clicks

17.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE