Question Details

(Solved) Assignment-3: Streams, Arrays, and Functions This assignment


I have so much assignments and projects to finish and don't think I'd be able to do this before the due date tomorrow. I am an automotive engineering student so programming isn't something I am good at (I only need one programming course in my entire years of studies and it isn't even a prerequisite for anything) . That is why I am asking for help on this so that I can finish it and hand it in. If there is any one who can help me out finish this, I'd appreciate it very much. I don't need to understand what you will do (I will figure it out if I have time and I want to understand), I just need a working code ?that makes sense and good commenting on each line. Thank you!


Assignment-3: Streams, Arrays, and Functions

 

This assignment involves materials from Chapters 5, 6, and 7 of the textbook. It is an intermediate

 

assignment that addresses applications of streams, arrays, and functions.

 

(35 Marks)

 

General Information and Policies

 

- All submissions must be submitted through the Blackboard system.

 

- Review the lecture notes and codes.

 

Objectives

 

The main objective of this assignment is to focus on the roles of streams, arrays, ad functions in problem

 

solving.

 

Reading

 

- Chapter 5.

 

- Chapter 6 (Random Numbers 6.5, Floating Point Sequence: Page 258).

 

- Chapter 7.

 

Resources

 

- Microsoft Visual Studio.

 

Programs Marking Rubric (marks are distributed using the electronic marking form)

 

1. Program design correctness: [40%].

 

2. Proper commenting and documenting: [10%].

 

a. Your code is commented, has a header section that shows the author, date and the

 

assignment that it belongs to. It further describes the purpose of the program.

 

- Typical Header Section

 

/**

 

@file problem1.cpp

 

@author Jenny Koo

 

@date 2016-1-28

 

@version 1.0

 

*/

 

b. In your code, use comments to explain the purpose of the variables declared, and the

 

intention with each, or almost each line of your code.

 

3. Compilation: [20%] your code compiles without error.

 

4. Execution and output: [20%] your code is executable, does not crash and produces the expected

 

output.

 

5. Code appearance and appropriate indentation: [10%] your code must be properly formatted.

 

Matching pairs of {} are in the same column, code in the main function is uniformly indented to

 

enhance readability, sections of code that belong together are visually set apart from other parts.

 

As an example, you should leave an empty line after the variable declaration).

 


 

Assignment 3

 


 

Introduction to Programming

 


 

ENGR 1200U

 


 

Winter 2016

 


 

Deliverables

 


 

-

 


 

The assignment solution formatted in .pdf file format and submitted by the due date using

 

the Blackboard dropbox.

 

Copies of the C++ programs.

 

Solution documentation that include listing of the codes and output screen snapshots

 

documented in .doc or .pdf files.

 


 

Submission Policy and Guideline

 


 

-

 


 

-

 


 

All submissions must adhere to the following guidelines:

 

o Programs should be submitted in .cpp format. The dropbox is configured to accept

 

multiple submissions of multi-parts.

 

o No file zipping is required and should be avoided as much as possible.

 

o Documentation of the solution should be submitted in .pdf file format that

 

includes:

 

Listing of the source of each program.

 

A compilation results (successful or unsuccessful) of each program

 

documented in a screen snapshot.

 

A run results of each program (if successful compilation is achieved)

 

documented in a screen snapshot.

 

o Naming Convention:

 

Each program should reflect the Problem number; for example, Problem 1

 

problem1.cpp

 

If the question has multi-parts, Problem 1 problem1a.cpp,

 

problem1b.cpp, etc.

 

Late Submissions:

 

o All submissions must be fulfilled through the Blackboard, no other means of

 

submissions is acceptable.

 

o If you encounter any issues while submission process of the assignment; it must

 

be reported before the closure date.

 

o Late submissions are the submissions that take affect after the due date and until

 

the closure date of the dropbox.

 

o No submissions will be accepted after the closure date.

 

o There will be 10% penalty per each day of late submission.

 


 

Assignment 3

 


 

Introduction to Programming

 


 

ENGR 1200U

 


 

Winter 2016

 


 

(10 Marks)

 

1. Critical-Path Analysis.

 

o A critical-path analysis is a technique used to determine the schedule for a project.

 

This information is important in the planning stages before a project is begun, and

 

it is also useful to evaluate the progress of a project that is partially completed. One

 

method for this analysis starts by dividing a project into sequential events and then

 

dividing each event into various tasks. Although one event must be completed

 

before the next one is started, various tasks within an event can occur

 

simultaneously. The time it takes to complete an event, therefore, depends on the

 

number of days required to finish its longest task. Similarly, the total time it takes

 

to finish a project is the sum of time it takes to finish each event. Assume that the

 

critical path information for a major construction project has been stored in a data

 

file. Each line of the data file contains an event number, a task number, and the

 

number of days required to complete the task. The data have been stored such that

 

all the task data for event 1 are followed by all the task data for event 2, and so on.

 

Thus, a typical set of data might be as follows:

 

Event

 

1

 

1

 

1

 

2

 

3

 

3

 

4

 

4

 

4

 

5

 


 

Task

 

15

 

27

 

36

 

15

 

18

 

26

 

15

 

26

 

27

 

16

 


 

Number of Days

 

3

 

6

 

4

 

5

 

4

 

1

 

2

 

7

 

7

 

4

 


 

1.1 Write a program to read the critical-path information and print a project completion

 

timetable that lists each event number, the maximum number of days for a task within the

 

event, and the total number of days for the project completion.

 

1.2 Write a program to read the critical-path information and print a report that liststhe event

 

number and task number for all tasks requiring more than five days.

 


 

Assignment 3

 


 

Introduction to Programming

 


 

ENGR 1200U

 


 

Winter 2016

 


 

2. Component Reliability.

 

(10 Marks)

 

Write a program that simulates the design shown below, using a component reliability of

 

0.8 for components 1 and 2, and 0.95 for components 3 and 4. Print the estimate of the

 

reliability, using 5,000 simulations. (The analytical reliability of this system is 0.9649.)

 


 

o

 


 

Use the function rand_float to generate your random reliability values:

 


 

//double rand_float(double a, double b);

 

double rand_float(double a, double b)

 

{

 

return ((double)rand()/RAND_MAX)*(b-a) + a;

 

}

 


 

Clarification: Analytical System Reliability Calculation

 


 


 

The analytical system reliability can be calculated by calculating the reliability of the components:

 

o (component 1) and (component 2) R12

 

R1-2 = R1 * R2`

 

R1-2 = .8 * .8 = .64

 

o (component 3) and (component 4) R34

 

R3-4 = R3 * R4`

 

R3-4 = .95 * .95 = .9025

 

o

 


 

The System Analytical Reliability (as 2 components in parallel) = (1- ((1-R1-2) * (1-R3-4))

 

= (1- ((1-.64) * (1-.9025))

 

= (1- ((.36) * (.0975))

 

= (1- ((.0351)) = .9649

 


 


 


 

In this problem we simulate 5000 tests that conform to the test:

 


 

if (((est1<=REL12) && (est2<=REL12)) || ((est3<=REL34) && (est4<=REL34))) success++;

 

o For the reliability of components in sequence, the estimated value must be always

 

be less than or equal calculated reliability (never more, due to the fact you always

 

multiply 2 fractions); hence, we count the valid attempts where the test suffice and

 

count those valid sets of reliability estimations using a counter (i.e. success).

 

o Simulation reliability is computed by: success/num_sim where num_sim is 5000.

 


 

Assignment 3

 


 

Introduction to Programming

 


 

ENGR 1200U

 


 

Winter 2016

 


 

(15 Marks)

 

3. Linear Interpolation.

 

The following problem refer to the wind-tunnel test data stored in the file tunnel.dat

 

(contents are below). The file contains the set of data which consists of a flight-path

 

angle (in degrees) and its corresponding coefficient of lift on each line in the file. The

 

flight-path angles will be in ascending order.

 

o Write a program that reads the wind-tunnel test data and then allows the user to

 

enter a flight-path angle. If the angle is within the bounds of the data set, the program should then use linear interpolation to compute the corresponding

 

coefficient of lift.

 

Angle

 

-4

 

-2

 

0

 

2

 

4

 

6

 

8

 

10

 

12

 

14

 

15

 

16

 

17

 

18

 

19

 

20

 

21

 

-

 


 

Lift-Coefficient

 

-0.182

 

-0.056

 

0.097

 

0.238

 

0.421

 

0.479

 

0.654

 

0.792

 

0.924

 

1.035

 

1.076

 

1.103

 

1.120

 

1.121

 

1.121

 

1.099

 

1.059

 


 

Utilize functions and arrays in your answer.

 


 

Assignment 3

 


 

Introduction to Programming

 


 

ENGR 1200U

 


 

Winter 2016

 


 

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 15, 2019

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now