Text book:
page 376 problem 1,2,3,4,5,6,7,8
You should submit your answer through the Google form which is sent to you by Email.
Due: next Monday Class time 04/22/13 10:10
Monday, April 15, 2013
Monday, April 8, 2013
Monday, April 1, 2013
Project 7: Simulate the system
Page 302. Problem 29
A good reference is "lecture 24 code sim_system" in dropbox.
zip archive
Due: next Monday 4/8/2013 midnight
A good reference is "lecture 24 code sim_system" in dropbox.
zip archive
Due: next Monday 4/8/2013 midnight
Thursday, March 28, 2013
Written Homework 5
Wednesday, March 20, 2013
Project 6: Prime Number output
Write a void function that uses two nested for loops and the modulus(%) operator to detect and print to a specified output file, the first n prime integers. Recall that a prime number is a number that is evenly divisible only by 1 and itself.
Hint: the function prototype is : void primeGen(int n, ofstream& file);
and a precondition is that file is defined.
Due: next Wednesday, 3/27/13 midnight
Hint: the function prototype is : void primeGen(int n, ofstream& file);
and a precondition is that file is defined.
Due: next Wednesday, 3/27/13 midnight
Monday, February 25, 2013
Project 5: Surture Packaging
Page 221, Problem 24
Due: next Monday midnight, 3/4/13
Suture Packaging. Sutures are strands or fibers used to sew living tissue together after an
injury or an operation. Packages of sutures must be sealed carefully before they are shipped to
hospitals so that contaminants cannot enter the packages. The object that seals the package is
referred to as a sealing die. Generally, the sealing die is maintained at an established temperature
and must contact the package with a predetermined pressure for an established time period. The
time period in which the sealing die contacts the package is called the dwell time. Assume that
the acceptable range of parameters for an acceptable seal, are the following:
Temperature: 150-170 degree C
Pressure: 60-70 psi
Dwell time: 2-2.5 s
24. A data file named suture.dat contains information on batches of suturtes
that have been rejected during a one-week period. Each line in the data file contains the batch
number, the temperature, the pressure, and the dwell time for a rejected batch. The quality
control engineer would like to analyze the information and needs a report that computes the
percent of the batches rejected due to pressure, due to temperature and the percent rejected due to dwell time. It is
possible that a specific batch may have been rejected for more than a reason and should be
counted in all acceptable totals. Write a program to compute and print these three percentages.
Use the following test data:
(The red numbers are what actually in your file.
-99s are sentinel signal for end checking.
You may want to use my class example(in dropbox) as your template)
(In order to make sure your program works properly, you could manually check out the results,
since the data file is very small.
For example, due to Temperature, it fails at batch 24551. So the percentage would be 1/5 = 20%
You could also check others)
Batch Number Temperature Pressure Dwell Time
24551 145.5 62.3 2.23
24582 153.7 62.3 2.52
26553 160.3 62.3 2.51
26623 159.5 62.3 2.01
26642 160.3 62.3 1.98
-99 -99 -99 -99
Due: next Monday midnight, 3/4/13
Suture Packaging. Sutures are strands or fibers used to sew living tissue together after an
injury or an operation. Packages of sutures must be sealed carefully before they are shipped to
hospitals so that contaminants cannot enter the packages. The object that seals the package is
referred to as a sealing die. Generally, the sealing die is maintained at an established temperature
and must contact the package with a predetermined pressure for an established time period. The
time period in which the sealing die contacts the package is called the dwell time. Assume that
the acceptable range of parameters for an acceptable seal, are the following:
Temperature: 150-170 degree C
Pressure: 60-70 psi
Dwell time: 2-2.5 s
24. A data file named suture.dat contains information on batches of suturtes
that have been rejected during a one-week period. Each line in the data file contains the batch
number, the temperature, the pressure, and the dwell time for a rejected batch. The quality
control engineer would like to analyze the information and needs a report that computes the
percent of the batches rejected due to pressure, due to temperature and the percent rejected due to dwell time. It is
possible that a specific batch may have been rejected for more than a reason and should be
counted in all acceptable totals. Write a program to compute and print these three percentages.
Use the following test data:
(The red numbers are what actually in your file.
-99s are sentinel signal for end checking.
You may want to use my class example(in dropbox) as your template)
(In order to make sure your program works properly, you could manually check out the results,
since the data file is very small.
For example, due to Temperature, it fails at batch 24551. So the percentage would be 1/5 = 20%
You could also check others)
Batch Number Temperature Pressure Dwell Time
24551 145.5 62.3 2.23
24582 153.7 62.3 2.52
26553 160.3 62.3 2.51
26623 159.5 62.3 2.01
26642 160.3 62.3 1.98
-99 -99 -99 -99
Monday, February 18, 2013
Announcement: Midterm time
The midterm date is
Wednesday Class time 03/06/13 10:10
The review data is
Monday Class time 03/04/13 10:10
Wednesday Class time 03/06/13 10:10
The review data is
Monday Class time 03/04/13 10:10
Written Homework 4
Text book:
page 152 Practice 5,6
page 176 problem 1,2,7,8,9
page 177 problem 14,15,16
You should submit your answer through the Google form which is sent to you by Email.
Due: next Monday Class time 02/25/13 10:10
page 152 Practice 5,6
page 176 problem 1,2,7,8,9
page 177 problem 14,15,16
You should submit your answer through the Google form which is sent to you by Email.
Due: next Monday Class time 02/25/13 10:10
Wednesday, February 13, 2013
Project 4
Page 178 Problem 25 <-- You are required to use a while-loop to solve this problem
Page 179 Problem 29 <-- You are required to use a for-loop to solve this problem
Since you have 2 problems this time, you will need to upload two cpp files and two executable files for the corresponding problems.
Due: 2/20/13 Wednesday midnight
Page 179 Problem 29 <-- You are required to use a for-loop to solve this problem
Since you have 2 problems this time, you will need to upload two cpp files and two executable files for the corresponding problems.
Due: 2/20/13 Wednesday midnight
Friday, February 8, 2013
Written Homework 3
Text book:
page 135 problem 1,2,3,4,5,7
page 136 problem 8,9,10,14
You should submit your answer through the Google form which is sent to you by Email.
Due: next Friday Class time 02/15/13 10:10
Problem 14:
page 135 problem 1,2,3,4,5,7
page 136 problem 8,9,10,14
You should submit your answer through the Google form which is sent to you by Email.
Due: next Friday Class time 02/15/13 10:10
Problem 14:
int a = 750;
if( a > 0 )
if(a >= 1000)
a=0;
else
a*=2;
else
a*=10;
Wednesday, February 6, 2013
Project 3: Age problem
Create an program that allows the user to input an age in years and then displays one of the following (or similar) responses. You program should be able to figure out how many years to display in some of the responses :
Age Range | Response | |
0 < age <6 | You are considered a young minor. But, in approximately ___ year(s) you will be able to attend school! | |
6<= age<16 | In approximately ___ year(s) you will be able to drive! | |
16<=age<21 | In approximately ___ year(s) you will be of legal drinking age. | |
21<=age<35 | You are of legal drinking age. In approximately ___ year(s) you will be able to run for president! | |
35<=age<120 | You are old enough to run for U.S. President. | |
age >= 120 | You are too enough to run for U.S. President. |
Tip: the most suitable type of age is "int"
"if-elseif-else" would be perfect for this program
Due: 2/13/13 midnight
Friday, February 1, 2013
Written Homework2
Text book
page 89. problem 1, 2, 5, 6, 7
page 90. problem 8,12,13,14,15
Due: next Friday 2/8/13 10:10 class time
page 89. problem 1, 2, 5, 6, 7
page 90. problem 8,12,13,14,15
Due: next Friday 2/8/13 10:10 class time
Wednesday, January 30, 2013
Project 2: Degree Conversion Assignment
Textbook page 91, problem 26
Here are some instructions.
1. You don't have to define any class in this project. We just need basic arithmetic programming.
2. You could use hard-coded degrees in your program. In other words, you don't have to ask user to input anything with "cin". ( However, if you could, it would be better but no extra credit.)
3. You do have to use "cout" to show your results on the screen.
4. Take care of the "integer division" issue.
Due time would next Wednesday 2/6/13 midnight.
Here are some instructions.
1. You don't have to define any class in this project. We just need basic arithmetic programming.
2. You could use hard-coded degrees in your program. In other words, you don't have to ask user to input anything with "cin". ( However, if you could, it would be better but no extra credit.)
3. You do have to use "cout" to show your results on the screen.
4. Take care of the "integer division" issue.
Due time would next Wednesday 2/6/13 midnight.
Wednesday, January 23, 2013
Project1: Hello World
Hello world on your machine.
Upload both the cpp file and executable.
Windows:
Follow the instruction I uploaded to install the MinGW.
Linux:
In your terminal, type
sudo apt-get install build-essential
MacOS:
Install Xcode where you could download from
https://developer.apple.com/downloads/index.action
Fill in the survey forms to get access to developer zone.
Then search the corresponding version based on your system.
Mountain Lion or Lion Xcode 4.5.2
Snow leopard Xcode 3.2.2 developer tools
Leopard Xcode 2.5
Then in the terminal, do what I did on class.
Friday, January 18, 2013
Written Homework 1
Page 32 10(a)(b) 11(a)(b) 12(a)(b) 13(a)(b)
10011.11012 = ?10
8.12510 = ?2
Due:
Friday, 25 January 2013, 10:10 AM
Go to Dropbox to check out the scanned questions on your textbook.
Create a text file(word doc, rtf or txt), put in your answers and upload to dropbox before the due date.
Tuesday, January 15, 2013
Subscribe to:
Posts (Atom)