Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CMPS 1053 - Program 3: Developing an Inventory Class (Spring 2009) - Prof. Ranette H. Halv, Assignments of Computer Science

The instructions for part 1 of cmps 1053 program 3, which involves creating an inventory class and demonstrating it through a main program. Students are required to create the class, initialize objects, set member properties, and output the values. Part 2 of the project will involve creating an application that uses the class.

Typology: Assignments

Pre 2010

Uploaded on 08/16/2009

koofers-user-3fu
koofers-user-3fu 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMPS 1053 - Program 3 Spring 2009
Part 1 Inventory Class
Due: Friday, February 27
* On this date, Part 2 will be assigned, an application that will use the class you have
programmed and tested in Part 1 of the assignment.
13. Inventory Class -Refer to the description on page 468 if your text for the description of the
member properties and the member functions.
Create a project including your main program (described below), Inventory.h, and
Inventory.cpp. They are to be constructed as described in the text and in class.
Part 1 of this project is to develop the class Inventory and simply demonstrate it through a
main program that demonstrates all member functions. Part 2 will be an application that will
use the class.
An overview of main is shown below. You will add all the additional code, comments, etc. to
complete the program. Use the data shown in the code.
int main ( )
{ Inventory Item1, Item2(53872, 17, 1.42);
Item1.setItemNumber(23415);
Item1.setQuantity (120);
Item1.setCost (2.01);
Item1.setTotal ( );
// Output is to be with appropriate comments telling what each value represents,
// spacing, $, alignment, etc. Output must includes the following for both
// Item1 and Item2.
Outfile << Item1.getItemNumber( ) << Item1.getQuantity( ) << Item1.getCost
<< Item1.getTotalCost;
}

Partial preview of the text

Download CMPS 1053 - Program 3: Developing an Inventory Class (Spring 2009) - Prof. Ranette H. Halv and more Assignments Computer Science in PDF only on Docsity!

CMPS 1053 - Program 3 – Spring 2009 Part 1 – Inventory Class

Due: Friday, February 27

  • On this date, Part 2 will be assigned, an application that will use the class you have programmed and tested in Part 1 of the assignment.
  1. Inventory Class -Refer to the description on page 468 if your text for the description of the member properties and the member functions.

Create a project including your main program (described below), Inventory.h, and Inventory.cpp. They are to be constructed as described in the text and in class.

Part 1 of this project is to develop the class Inventory and simply demonstrate it through a main program that demonstrates all member functions. Part 2 will be an application that will use the class.

An overview of main is shown below. You will add all the additional code, comments, etc. to complete the program. Use the data shown in the code.

int main ( ) { Inventory Item1, Item2(53872, 17, 1.42);

Item1.setItemNumber(23415); Item1.setQuantity (120); Item1.setCost (2.01); Item1.setTotal ( );

// Output is to be with appropriate comments telling what each value represents, // spacing, $, alignment, etc. Output must includes the following for both // Item1 and Item.

Outfile << Item1.getItemNumber( ) << Item1.getQuantity( ) << Item1.getCost << Item1.getTotalCost; }