CSE 1321 Programming and Problem Solving Lab Assignment

Assignment Help C/C++ Programming
Reference no: EM132392375

CSE 1321: Programming and Problem Solving Lab Assignment, Kennesaw State University, USA

Exercise 1: Design and implement class Rectangle to represent a rectangle object. The class defines the following attributes (variables) and methods:

1. Two Class variables of type double named height and width to represent the height and width of the rectangle. Set their default values to 1.0 in the default constructor.

2. A non-argument constructor method to create a default rectangle.

3. Another constructor method to create a rectangle with user-specified height and width.

4. Method getArea() that returns the area.

5. Method getPerimeter() that returns the perimeter.

6. Method getHeight() that returns the height.

7. Method getWidth() that returns the width.

Now design and implement a test program to create two rectangle objects: one with default height and width, and the second is 5 units high and 6 units wide. Next, test the class methods on each object to print the information as shown (attached).

Exercise 2: Design and implement class Stock to represent a company's stock. The class defines the following attributes (variables) and methods:

1. A class variable of type String named Symbol for the stock's symbol.

2. A class variable of type String named Name for the stock's name.

3. A class variable of type double named previousClosingPrice to store the last closing price.

4. A class variable of type double named currentPrice to store the current price.

5. A constructor method to create a stock with user-specified name and symbol.

6. Method getName() that returns the stock's name.

7. Method getSymbol() that returns the stock's symbol.

8. Method setClosingPrice() that sets the previous closing price.

9. Method setCurrentPrice() that sets the current price.

10. Method getChangePercent() that returns the percentage changed from previousClosingPrice to currentPrice.

Use the formula: (currentPrice - previousClosingPrice)/ currentPrice * 100

11. Method named toString() (Java & C#) to printout a meaningful description of a stock object when passing the object name to the print statement.

e.g.: The statement PRINT yahooStock would print the string:

Yahoo stock's closing price is $234.54.

Now design and implement a test program to create two stock objects: one for Google with symbol GOG and the second is for Microsoft with symbol MSF. Set their closing and current prices according to the information. Next, test the class methods on each object to print in the information in a similar manner to the one shown (see attached file).

Instructions: Programs must be working correctly.

Attachment:- Programming and Problem Solving Lab Assignment File.rar

Verified Expert

The task of the assignment is to develop 2 C# programs.Exercise 1 is to implement a Rectangle class. The rectangle class contains methods that returns the area and perimeter of rectangle for the given height and width of rectangle. The Exercise 1 also contains the test program which tests the functionality of rectangle class. Exercise 2 is to implement a Stock class. The class contains getter and setter function for each attributes of class. The class also contains function to determine change percent from previous closing price to current price. The Exercise 2 also contains the test program which tests the functionality of stock class.

Reference no: EM132392375

Questions Cloud

Upcoming new information systems project : What if your a project manager for an upcoming new information systems project designed to replace your organization's old inventory management system.
Explain what it means to have efficient capital market : The purpose of this assignment is to allow the student an opportunity to explain what it means to have an efficient capital market.
What is artificial intelligence : What is Artificial Intelligence? How to use Artificial Intelligence in the hotel industry?
Outsourcing housekeeping operations : Increasingly, some hotel chains are outsourcing their housekeeping operations. What would likely be some advantages of taking such an approach to room cleaning
CSE 1321 Programming and Problem Solving Lab Assignment : CSE 1321: Programming and Problem Solving Lab Assignment, Homework Help, Kennesaw State University, USA - Design and implement class Rectangle
Research and compose a position paper that demonstrates : Research and compose a position paper that demonstrates how you see and value ethics in business based upon the end of chapter case studies.
Course description of discussion facilitation : Discussion facilitation is an important and useful skill. Each group will be also responsible for facilitating a class discussion of the weekly memo question.
Strategic management of nonprofit organizations : What is the one thing most likely to affect strategic management of nonprofit organizations?
Differences in taxing of different types of organizations : Explain the differences in taxing of four different types of organizations.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd