CST8116-Exercise 3( yuvraj singh )

.docx

School

Algonquin College *

*We aren’t endorsed by this school

Course

8116

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

6

Uploaded by ColonelYakMaster1015

CST8116 Introduction to Computer Programming Lab Exercise 03 Sample Solution (21S) Assessment: Exercise 03 Student Name: Yuvraj singh Lab Professor Name: Jinal Jadav Lab Section Number: 3 Due Date: Part 1 Understand the problem: 1) I need to create a program for a startup company that be used to compare the Price of grocery items across the different grocery Stores, and they want to track grocery items, Stores and Price of the items. 2) For this program, I would need to use Constructors, Accessors(getter) and Mutators(setter). 3) I would need to generate a report showing the grocery item, Store and Price separated by commas. 4) UML class diagram :-
LAB3 - Name: String -Store: String -Price: double + Lab3(Name: String, Store: String, Price: double) + getName( ): String + getStore( ): String + getPrice( ): double + setName( Name: String): void + setStore( Store: String): void + setPrice( Price: double): void + generateReport(): String + main(args: String[]): void
Part 2 • A) Pseudocode. class Lab3 //Declaring variables string Name; String Store; double Price; //Constructor Function lab3 (Name,Store,price): This.Name = Name This.Store = Store This.Price = Price // Accessors function getName(): return Name function getStore(): return Store function getPrice(): return Price //Mutators function setName(Name): this.Name = Name function setStore(Store): this.Store= Store function setPrice(Price): this.Price=Price // Method to generate report
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help