The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 327 Weeks Ago, 5 Days Ago |
| Questions Answered: | 12843 |
| Tutorials Posted: | 12834 |
MBA, Ph.D in Management
Harvard university
Feb-1997 - Aug-2003
Professor
Strayer University
Jan-2007 - Present
Assignment 3 for Tutorials (Due Wednesday June 21 at 11:59pm) –
This assignment will focus on the FILE I/O and FUNCTIONS.
•
• In this assignment, you will need to upload your C++ file (file_name.cpp) to the Blackboard Drop
Box.
There are 4 different topics and each student will be assigned a question. If you do not do the question that is assigned you will receive a mark of 0 for the entire assignment.
•
•
•
•
•
•
•
•
• The assignment is worth 4% of your final grade and is marked out of 4.
Your code must run on Visual Studio, if we (The TA’s) cannot run your code you will receive a
mark of 0 for all sections but comments.
Evidence of plagiarism and/or cheating will result in a mark of 0 for the assignment.
Your code needs to be documented with comments explaining what your code is doing.
Improper/No documentation will result in loss of marks.
You are not allowed to use arrays or features of C++ that are not covered in the course.
You can use the Math Function.
All calculations must be carried out in functions.
Follow the instructions on each topic and deliver what is being asked.
The TA’s will not be able to provide any assistance in the completion of this project other than
clarification to the topics. Component Poor (0/3)
Code Comments No Acceptable (1/3) Good (2/3) Excellent (3/3) Sparse Comments no
errors/ Good comments
a single error. Sparse
Comments with
no errors Highly readable and
well explained
comments Completes task without
FILE I/O Completes one
of the tasks
with one of FILE
input or File
output and
other task is
completed
manually. Function (Use) No Use of Use of function
correctly but operation
has a major error. Program
Completeness Program executes but
does not perform as
outlined by the
assignment or has major
errors. Use of function
correctly but
operation has a
minor error.
Program
executes but
has only minor
errors (too
many variables)
as outlined by
the assignment. comments/Incorr
ect Comments
(multiple) FILE I/O No use of File I/O
– (code does not
run) Function to
complete
calculations.
Incomplete
Program (Does
not run, incorrect
assignment) Weight
0.5 Total
out of
0.5 Assignment Tasks
are completed with
both FILE input and
output 1 out of
1 Use of Function and
correct operation 1 out of
1 Performs Flawlessly 1.5 out of
2 For Everyoneassignment3.txt will have the following properties:
•
•
• The first line determines the number of entries, this will not be used in your calculations. Using
this value in the core calculations will result in incorrect results.
There will be values from 1 – 100. Only integer values.
This text file will be common for all students even though there will be four separate topics. Topic 1 –
Read from the file (assignment3.txt) that is attached on blackboard and calculate the volume of a
sphere. The values that you are reading are in centimeters. After this done you will need to evaluate if
the volume of the sphere is over 1.250 m^3 you will assign the value of the sphere as large. Others will
be assigned a value of small. You will then need to write the properties to a text file. The output should
resemble the table below. The volume needs to be output to 2 digits with units. The output file name
will be volume.txt.
Number
1
2 Volume
2.14m^3
0.14m^3 Radius
0.80m
0.32m Property
Large
Small Topic 2 –
Read from the file (assignment3.txt) that is attached on blackboard and calculate the average of all the
grades. The values that you are reading are percentage grades from 1 – 100. After this done you will
need to say if the student passed (50 percent and higher). You will then need to write the properties to
a text file. The output should resemble the table below (must include % in the output. You will need to
print the average at the end of the list. And if the average is a pass/fail and the highest and smallest
mark. The output file name is grades.txt.
Student
1
2 Grade
37%
63% Pass/Fail
Fail
Pass The average is 50%. The average is a pass. The highest mark was 63 and the lowest mark was 37. Topic 3 –
Read from the file (assignment3.txt) that is attached on blackboard and identify if the numbers are
prime or not. The values that you are reading are integers from 1 – 100. After this done you will need
to say if the number is prime. Then you will sum the numbers that are not prime, and sum the numbers
that are prime and compare if the total of primes is greater than non primes. The output file name will
be primes.txt.
Prime
Number
Yes
97
No
4
The total value of primes is: 97. The total value of non-primes is: 4. The value of primes is larger than
non-primes. Topic 4 –
Read from the file (assignment3.txt) that is attached on blackboard and calculate the perimeter of the
fence. The values that you are reading are integers from 1 – 100 in meters, you will need to read in
pairs of values. After this done you will need to determine the number of fence posts you will need, the
spacing of the posts is no more than 5m. You will then need to output the values into a table with in a
text file named fence posts. The output filename will be fence.txt.
Fence
1
2 Length
10
2 Width
5
3 Perimeter
30
6 # Posts
6
4
Â
Attachments:
-----------