100% Guaranteed Results


ENCMP 100 – Computer Programming for Engineers Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Assignment #3
Objective

This assignment is designed to provide you with practice using repetition/loops structures in your program.

Loops allow a set of statement(s) to be repeated. There are basically two types of looping in programming, counted loops and conditional loops. A counted loop allows statement(s) to be repeated for a known number of times, while for the conditional loop, the number of times for the statements to be repeated is not known in advance, but depends on a specified condition in the loop statement.

Marking Scheme
This assignment is worth 3% of your final mark. You will get a total of 50 points for completing the following:

TASK POINTS
Part A: Correct display of results 17
Part B: Correct display of results 17
Quality of code (8 points for each part) 16
TOTAL 50

Points for Quality of Code:
• Complete file header – 2 point
• Design (appropriate use and naming of variables) – 2 points
• Comments in the code – 2 points
• Layout (indentation/spacing) – 2 point

Submission
• Submit only your .m file under Assignment 3A and 3B in your eClass/Moodle account.

Problem and Program Details:

With the help of an RESP (Registered Education Savings Plan), a parent can start putting aside money for a child’s post-secondary education. Suppose that a young couple deposits $1000 to start the savings plan, and each month thereafter they contribute $200. Assume that a fixed interested rate of 6% per year compounded monthly is applied, equivalent to a monthly interest rate of 0.5%.

Each month the balance increases according to the following formula:

New balance = Old balance + (Old balance * Monthly interest rate)
+ Monthly contribution
(1)

New cost = Old cost + (Old cost * Annual increase rate) (2)

Part A:

Steps:
1. Calculate the monthly balance of the savings plan for the next 18 years, based on the formula in equation (1). Save the amount in a vector or an array.

Output:

To summarize, in this Part, your program needs to generate the following outputs:

– An answer to whether or not the parents are saving enough, in the command window;
– A plot showing both the plot of the annual savings vs. the years, and the threshold line (for the cost). Please label your plot properly.

Sample Screenshots should look similar to the ones included.

Assignment 3 – Part A Submission:

For part A of this assignment, please submit your solution to eClass under Assignment 3A. With the following naming convention:

Assign3A_<UofA_ID>.m
Ex. U of A ID Number: 1234567890 filename will be
Assign3A _1234567890.m

Part B:

How much does the couple need to put on a monthly basis in order to achieve the goal of saving enough for the predicted 4-year tuition fee?

1. Assume that the monthly payment increases from 50 dollars with an increment of $10 each time and repeat the calculations in Part A, until the saving goal is reached. For this, the students are asked to use a while loop.

2. Save the ‘minimum’ monthly contribution and print it on the command window.

Output:
For this part, your program should generate the following output
– Print out the minimum monthly contribution for the savings plan with respect to each chosen academic program

Your output should look like the example screenshots below.

For Arts:

For Science:

For Engineering:

Assignment 3 – Part B Submission:

For part B of this assignment, please submit your solution to eClass under Assignment 3B. With the following naming convention:

Assign3B_<UofA_ID>.m
Ex. U of A ID Number: 1234567890 filename will be
Assign3B _1234567890.m

Code Requirements

You must use two types of loops in your programs for this assignment, for and while loops.

Hints

1. Before you even begin to write out any MATLAB code, sit down and sketch out your program design in abbreviated English. This kind of high-level program design is called pseudo code (Please refer to page 59 – 60 of the course notes).

2. At the beginning of the program, you can use an input statement together with a switch/case statement for selecting from 3 academic programs, and assigning the initial tuition fee with respect to the chosen program.

3. Use the built-in MATLAB functions, such as sum, plot, num2str, disp, and fprintf
(for fprintf, please refer to page 78 of the course notes)

4. Please remember to include your header at the top of your *.m file.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Course: ENCMP 100
% Assignment: 3
% Lab Section: A2
% Name: Joe MacDonald
% CCID: jmac
% UofA ID: 1234567890
% Acknowledgements: I received help from Jason Smith on using
%
% File: Assign3x_1234567890.m
% Description:

Reviews

There are no reviews yet.

Be the first to review “ENCMP 100 – Computer Programming for Engineers Solved”

Your email address will not be published. Required fields are marked *

Related products