Question: I need the answer in java Assignment 1 Important Notes: a. NAME STRINGS, CLASSES AND VARIABLES AS MENTIONED b. All files should be in one

 I need the answer in java Assignment 1 Important Notes: a.
NAME STRINGS, CLASSES AND VARIABLES AS MENTIONED b. All files should be
in one folder hw2YOURNAME (hw 2Sara) c. All files should be.java files
I need the answer in java

Assignment 1 Important Notes: a. NAME STRINGS, CLASSES AND VARIABLES AS MENTIONED b. All files should be in one folder hw2YOURNAME (hw 2Sara) c. All files should be.java files (qlsara.java, q2sara.java, ...) with your Name & ID as comment in the top of the programs d. Don't forget to change class name to match file name (qisara.java--> class name should be qlsara) e. Compress your folder and upload f. Don't wait for the last minute, the upload my take some time and if the submission is closed it will not be reopened g. The files should also contain the output as a comment at the end of the program between /**/ h. You have two jokers to be used for the homework. Each joker will give you a 24 hours delay. Once the homework is discussed in class no joker is accepted 1. Write an application that takes two numbers consisting of one digit from the user and combine the numbers into a two-digit number. Assume that the user will not enter zero as the first number (if you can handle this you will get a bonus) Sample Run: Enter a one-digit integer: 4 Enter a one-digit integer: 2 The combined integer: 42 2. Write a program that add, subtract, multiply and divide five integers read from the user. Sample Run : Enter an integer: 10 Enter an integer: 2 Enter an integer: 1 Enter an integer: 2 Enter an integer: 3 The addition result is 18 The subtraction result is 2 The multiplication result is 120 The division result is 0.833 3. Create a class called Stock that can be used to handle stock marker operations. Your class should contain the following: A string data field named symbol for the stock's symbol A string data field named name for the stock's name A double data field name previousClosing Price that stores the stock price for the previous day A double data field named currentPrice that stores the stock price for the current time A constructor that creates a stock with specified symbol and name The set method for all data fields The get method for all data fields A method named changePercent() that returns the percentage changed from previous Closing Price to currentPrice. [(New Price - Old Price) Old Price] Write a test program that creates two Stock class objects with the following information: Stock symbol ABC, the name Name Inc., and the previous closing price of 60. Set a new current price to 65 and display the price-change percentage. Stock symbol BCC, the name News Inc., and the previous closing price of 100. Set a new current price to 110 and display the price-change percentage. Sample Output: Stock Information: Symbol: ABC Name: Name Inc. Previous Closing Price: 60.00 Current Price: 65.00 Price-Changed Percentage: 8.33 % Symbol: BCC Name: News Inc. Previous Closing Price: 100.00 Current Price: 110.00 Price-Changed Percentage: 10% 4. Write a class called PhoneBook that is used to keep track of a person contacts. Your class should store the name, phone number and email. Assume each user has 2 contacts only. Read the contacts information from the user. Your call should have a constructor that sets all the variables. Your class should have a set and get method for each instance variable. Write a test class to test you class capabilities Sample Output: Enter name 1: Ahmed Salem Enter phone number 1: 99887733 Does he/she have an email (1. Yes -2. No): 2 Enter email 1:a.h@gmail.com Enter name 2: Khalid Ameer Enter phone number 2: 66773443 Does he/she have an email (1. Yes - 2. No): 2 Phone Book: Name 1: Ahmed Salem Phone Number 1: 99887733 Email 1: a.h@gmail.com Name 2: Khalid Ameer Phone number 2: 66773443 Email: None

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!