Difference: Lab0Intro (1 vs. 5)

Revision 52018-01-22 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Fall2017"

Lab 0

Line: 69 to 69
  Submit your programs on Moodle by midnight, August 31.

Grading Table

Changed:
<
<
RequirementGrading CommentsPointsSort by this column
Working Code for #1 25
Three working runs for #1 25
Working Code for #2 25
Three working runs for #2 25
Total 100

>
>
RequirementGrading CommentsPointsGrade
Working Code for #1 25
Three working runs for #1 25
Working Code for #2 25
Three working runs for #2 25
Total 100

 \ No newline at end of file

Revision 42018-01-22 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Fall2017"

Lab 0

Line: 7 to 7
  Lab based on Chapter 1.
Changed:
<
<
0) The purpose of this exercise is to produce a catalog of typical syntax errors and error messages that will be encountered by a beginner, and to continue acquainting you with the programming environment. This exercise should leave you with a knowledge of what error to look for when given

any of a number of common error messages.

>
>
0) The purpose of this exercise is to produce a catalog of typical syntax errors and error messages that will be encountered by a beginner, and to continue acquainting you with the programming environment. This exercise should leave you with a knowledge of what error to look for when given any of a number of common error messages.
  Create a new project, and put in the code below. Make sure you can run it.
Line: 57 to 55
  a. Put an extra space between the < and the iostream file name.
b. Omit one of the < or > symbols in the include directive.
c. Omit the int from int main() .
d. Omit or misspell the word main .
e. Omit one of the ( ) , then omit both the ( ) .
f. Continue in this fashion, deliberately misspelling identifiers (cout , cin , and so on). Omit one or both of the << in the cout statement; leave off the ending curly brace } .
Changed:
<
<
You do not need to turn this in.
>
>
You do not need to turn the above part in, only what follows.
  1) (50 pts) Write a C++ program that reads in two integers and then outputs both their sum and their product. One way to proceed is to start with the sample program from class and then modify that program to produce the program for this project. Be certain to type the first line of your program exactly the same as the first line in class. In particular, be sure that the first line begins at the left-hand end of the line with no space before or after the # symbol. Also, be certain to add the symbols \n to the last output statement in your program. For example, the last output statement might be the following:

cout << "This is the end of the program.\n";

Changed:
<
<
Hand in the code and three different runs of the program.
>
>
Hand in the code and three different runs (with different inputs) of the program. Copy the run (inputs and outputs from the "Output" window into a document to turn in on moodle.)
  2) (50 pts) Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.
Line: 71 to 69
  Submit your programs on Moodle by midnight, August 31.

Grading Table

Deleted:
<
<
RequirementGrading CommentsPointsScore
Working Code for #1 25
Three working runs for #1 25
Working Code for #2 25
Three working runs for #2 25
Total 100

 \ No newline at end of file
Added:
>
>
RequirementGrading CommentsPointsSort by this column
Working Code for #1 25
Three working runs for #1 25
Working Code for #2 25
Three working runs for #2 25
Total 100

Revision 32018-01-16 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Fall2017"

Lab 0

Changed:
<
<
Moodle Link
>
>
Moodle Link
 

Lab based on Chapter 1.

Revision 22017-08-31 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Fall2017"

Lab 0

Line: 67 to 67
  2) (50 pts) Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.
Changed:
<
<
Hand in the code and three different runs of the program.
>
>
Hand in the code and three different runs of the program.
  Submit your programs on Moodle by midnight, August 31.

Grading Table

Revision 12017-08-30 - JimSkon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="Fall2017"

Lab 0

Moodle Link

Lab based on Chapter 1.

0) The purpose of this exercise is to produce a catalog of typical syntax errors and error messages that will be encountered by a beginner, and to continue acquainting you with the programming environment. This exercise should leave you with a knowledge of what error to look for when given

any of a number of common error messages.

Create a new project, and put in the code below. Make sure you can run it.

<-- SyntaxHighlightingPlugin -->
#include <iostream>
using namespace std;
int main( )
{
    int number_of_bars;
    double one_weight, total_weight;

    cout << "Enter the number of candy bars in a package" << endl;
    cout << "and the weight in ounces of one candy bar." << endl;
    cout << "Then press return." << endl;
    cin >> number_of_bars;
    cin >> one_weight;

    total_weight = one_weight * number_of_bars;

    cout << number_of_bars << " candy bars" << endl;
    cout << one_weight << " ounces each" << endl;
    cout << "Total weight is " << total_weight << "ounces." << endl;

    cout << "Try another brand." << endl;
    cout << "Enter the number of candy bars in a package" << endl;
    cout << "and the weight in ounces of one candy bar." << endl;
    cout << "Then press return." << endl;
    cin >> number_of_bars;
    cin >> one_weight;
    total_weight = one_weight * number_of_bars;

    cout << number_of_bars << " candy bars" << endl;
    cout << one_weight << " ounces each" << endl;
    cout << "Total weight is " << total_weight << " ounces." << endl;

    cout << "Perhaps an apple would be healthier." << endl;

    return 0;
}
<-- end SyntaxHighlightingPlugin -->

Deliberately introduce errors to the program, compile, record the error and the error message, fix the error, compile again (to be sure you have the program corrected), then introduce another error. Keep the catalog of errors and add program errors and messages to it as you continue through this course.

The sequence of suggested errors to introduce is:

a. Put an extra space between the < and the iostream file name.
b. Omit one of the < or > symbols in the include directive.
c. Omit the int from int main() .
d. Omit or misspell the word main .
e. Omit one of the ( ) , then omit both the ( ) .
f. Continue in this fashion, deliberately misspelling identifiers (cout , cin , and so on). Omit one or both of the << in the cout statement; leave off the ending curly brace } .

You do not need to turn this in.

1) (50 pts) Write a C++ program that reads in two integers and then outputs both their sum and their product. One way to proceed is to start with the sample program from class and then modify that program to produce the program for this project. Be certain to type the first line of your program exactly the same as the first line in class. In particular, be sure that the first line begins at the left-hand end of the line with no space before or after the # symbol. Also, be certain to add the symbols \n to the last output statement in your program. For example, the last output statement might be the following:

cout << "This is the end of the program.\n";

Hand in the code and three different runs of the program.

2) (50 pts) Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.

Hand in the code and three different runs of the program.

Submit your programs on Moodle by midnight, August 31.

Grading Table

RequirementGrading CommentsPointsScore
Working Code for #1 25
Three working runs for #1 25
Working Code for #2 25
Three working runs for #2 25
Total 100

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback