Skip to content

Mrk0p/RPS-OOPs_programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

RPS-OOPs_programs

  1. Stock Account Management a. Desc -> Write a program to read in Stock Names, Number of Share, Share Price. Print a Stock Report with the total value of each Stock and the total value of Stock. b. I/P -> N number of Stocks, for Each Stock Read In the Share Name, Number of Share, and Share Price c. Logic -> Calculate the value of each stock and the total value d. O/P -> Print the Stock Report. e. Hint -> Create Stock and Stock Portfolio Class holding the list of Stocks read from the input file. Have functions in the Class to calculate the value of each stock and the value of total stocks.

  2. Modify class Account to provide a method called debit that withdraws money from an Account. Ensure that the debit amount does not exceed the Account’s balance. If it does, the balance should be left unchanged and the method should print a message indicating ―Debit amount exceeded account balance. Modify class AccountTest to test method debit.

  3. Commercial data processing - StockAccount.java implements a data type that might be used by a financial institution to keep track of customer information. The StockAccount class implements following methods

The StockAccount class also maintains a list of CompanyShares objects which have Stock Symbol and Number of Shares as well as DateTime of the transaction. When buy or sell is initiated StockAccount checks if CompanyShares are available and accordingly update or create an Object.

  1. Write a Program DeckOfCards.java, to initialize deck of cards having suit ("Clubs", "Diamonds", "Hearts", "Spades") & Rank ("2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"). Shuffle the cards using Random method and then distribute 9 Cards to 4 Players and Print the Cards received by the 4 Players using 2D Array...

  2. Extend the above program to create a Player Object having Deck of Cards, and having ability to Sort by Rank and maintain the cards in a Queue implemented using Linked List. Do not use any Collection Library. Further the Players are also arranged in Queue. Finally Print the Player and the Cards received by each Player.

About

Object oriented Programs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages