PUT IN JAVA PROGRAMMING
The Stock class: Design a class named Stock that contains:
• A string data field named symbol1 for the stock’s symbol.
• A string data field named name for the stock’s name.
• A double data field named previousClosingPrice 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 the specified symbol and
name.
• A method named getChangePercent() that returns the percentage
changed from previousClosingPrice to currentPrice.
• Write a test program that creates a Stock object with the stock
symbol ORCL, the name Oracle Corporation, and the previous closing
price of 34.5. Set a new current price to 34.35 and display the
price-change percentage.
In: Computer Science
Using java you have to create a simple program that will allow for the storage of requests for money. Each request will consist of a person's name and dollar amount (US dollars). The business rules are straight forward. Each name should be a first and last name. The first letter of each element in the name should be capitalized. The dollar amount should be between 1 and 1000 dollars and include cents (2 decimals). You should include validations, but it will be left to you to decide if they will methods in the data entry program, or methods from a validation class. The data entered for each request should be written to an encrypted file. Use combo boxes and "good lists" where appropriate. Throw exception objects to handle errors and fail securely.
In: Computer Science
What is a potential solution for an Array that contains these lines to find a regex solution first names only and a separate regex solution for last names? (PYTHON)
John Doe
John, E. Doe
John, E., Doe
John, Doe E.
John, Doe
Jo hn, Doe Jr. (first name is "Jo hn")
John, Doe III
John, E Doe
Expect OutPut (bolded - first name (1st regex), italicized - last name (2nd regex))
John Doe
John, E. Doe
John, E., Doe
John, Doe E.
John, Doe
Jo hn, Doe Jr. (first name is "Jo hn")
John, Doe III
John, E Doe
In: Computer Science
Three employees in a company are selected for a pay increase. You are given a file (salaries.txt) that contains three lines. Each line in the file consists of an employee’s last name, first name, current salary, and percent pay increase. For example, in the first line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87 and the pay increase is 5%. Write a program that reads data from the file and stores the output in another file. The output data must be in the following format: FirstNameInitial lastName updatedSalary Format the output of decimal number to two decimal places. For example, the first line in the output may look like the following: A. Miller 69079.36 I want help to solve it on netbeans
In: Computer Science
Consider the following java class:
class Student {
private int student_Number;
private String student_Name;
public Student(int stNo,String name) {
student_Number=stNo;
student_Name=name;
}
public String getName() {
return student_Name;
}
public int getNumber() {
return student_Number;
}
public void setName(String st_name) {
student_Name = st_name;
}
}
Write a Tester class named StudentTester which contains the following instruction:
Note:
Include the screenshot of the program output as a part of your answer. Otherwise, you will be marked zero for this question.
In: Computer Science
Write program#1 upload .java file. #1 Write a java program that prompts the user for input using the Scanner class. First to enter their first name. Then prompts the user to enter their last name. Then prompts the user to enter their city. Then prompts the user to enter their state. Then prompts the user to enter their zip code. Concatenate first name and last name into full_name. Using String Class is optional. Use the String Class to replace zip code "0" with "N", replace "7" with "J". Use the String Class to make all the values upper case. Use the String Class to determine the length of full_name. Print on first line full_name and length of full_name. Print all on second line mailing address, including zip_string?
In: Computer Science
(1) Create three files to submit.
(2) Build the ContactNode class per the following specifications:
Parameterized constructor. Parameters are name followed by phone number.
Public member functions
Private data members
Ex. of PrintContactNode() output:
Name: Roxanne Hughes Phone number: 443-555-2864
(3) In main(), prompt the user for three contacts and output the
user's input. Create three ContactNodes and use the nodes to build
a linked list. (2 pts)
Ex:
Person 1 Enter name: Roxanne Hughes Enter phone number: 443-555-2864 You entered: Roxanne Hughes, 443-555-2864 Person 2 Enter name: Juan Alberto Jr. Enter phone number: 410-555-9385 You entered: Juan Alberto Jr., 410-555-9385 Person 3 Enter name: Rachel Phillips Enter phone number: 310-555-6610 You entered: Rachel Phillips, 310-555-6610
(4) Output the linked list. (2 pts)
Ex:
CONTACT LIST Name: Roxanne Hughes Phone number: 443-555-2864 Name: Juan Alberto Jr. Phone number: 410-555-9385 Name: Rachel Phillips Phone number: 310-555-6610
main.cpp
#include <iostream>
using namespace std;
int main() {
/* Type your code here. */
return 0;
}
ContactNode.cpp
ContactNode.h
How do you write this code?
In: Computer Science
code in C
Step 1
For example: chrLetter = fgetc( pfilInput );
Step 2
typedef struct
{
long lngRecordID;
char strFirstName[ 50 ];
char strMiddleName[ 50 ];
char strLastName[ 50 ];
char strStreet[ 100 ];
char strCity[ 50 ];
char strState[ 50 ];
char strZipCode[ 50 ];
} udtAddressType;
Step 3
Step 4
------------------------------------------------------------
Customer #1
First Name: Luke
Middle Name:
Last Name: Skywalker
Address: 123 Elm Street
City: Corusant
State: Ohio
Zip Code: 45202
------------------------------------------------------------
Customer #2
…
Extra Credit
Extra Extra Credit
In: Computer Science
To meet rising demands for health care, a new form of clinics has begun to emerge: clinics run by nurse practitioners says the New York Times.
Many of these nurse practitioners are limited in what they can and can't do based on state law. In some states, nurse practitioners are completely free to treat patients and give prescriptions. However, some states won't allow these clinics without at least one trained physician.
These clinics staffed with nurse practitioners offer an avenue for alleviating some of the strain being put on primary care physicians. Indeed, the Affordable Care Act will bring 32 million uninsured people into the health system and there aren't enough primary care physicians to cover them. Furthermore, physicians are poorly distributed, many of them opting to work in urban areas rather than rural towns.
Some critics of having nurse practitioners run clinics argue that the quality of care is compromised for patients.
Moreover, nurse-led clinics are cheaper than traditional doctor-led practices. Furthermore, these clinics are small and don't need a variety of practitioners to keep the clinic at full capacity. Finally, nurse practitioner-led clinics provide patients with an alternative to the emergency room, which results in large savings.
Question:
Discuss your position and analyze how this problem could become a major problem and affect more Americans in the future.
In: Operations Management
The COVID 19 pandemic and the associated lockdown has led to an increase in aggregate prices of food in Ghana. Using your understanding of (a) the fundamental causes of inflation, (b) the aggregate demand and aggregate supply curve (LR and SR) shifts, provide your sound reasoning for why this aggregate food price increases could have happened in this season.
[30 Marks]
2.
Using the data on the Economy of Ghana provided below, answer the following questions:
Price index of Agriculture (2015=100) Constant (2015) Prices ( Billion
Ghana Cedis)
2016 2017 2018 2019 2016 2017 2018 2019
1. TOTAL AGRICULTURE 130.6 174.4 222.4 317.8 2.89 2.99 3.12 3.06
1.1 Agriculture and
Livestock 133.7 174.0 211.8 317.3 1.99 2.11 2.22 2.13
1.2 Cocoa Production and
Marketing 140.4 209.1 305.6 391.9 0.47 0.44 0.45 0.47
1.3 Forestry and Logging 108.1 144.2 174.1 244.9 0.32 0.33 0.37 0.35
1.4 Fishing 98.2 134.6 199.1 221.7 0.11 0.11 0.11 0.12
a. Compute the real growth rate in total agriculture for 2017, 2018 and 2019. Interpret your results. As an advisor to the Minister of Agriculture, what economic advice will you give him?
b. In real terms, the forestry and logging subsector grew faster than that of the fishing subsector in 2017. Do you agree with this statement? Why?
c. Compute the inflation for total agriculture for each period from 2016 to 2019.
Interpret your observations carefully.
[20 Marks]
3.
a. You have been given the following data:
Net non-business interest income 24
Government purchases 670
Corporate retained earnings 73
Gross private investment 530
Depreciation 10
Net exports -240
Personal consumption 2800
Transfer payments from government 54
Foreign factor income earned domestically 320
Personal taxes 84
Social security taxes 67
Income from foreign domestic factor sources 300
Indirect taxes 45
On the basis of these data calculate:
(i) GDP
(ii) GNP
(iii) NNP
(iv) NI
(v) PI
(vi) Disposable personal income
[20 Marks]
Show working with explanations.
b. Differentiate clearly between currency revaluation and currency appreciation.
[5 Marks]
c. Discuss five (5) of the omissions from GDP that over/undervalue Ghana’s GDP. What do these mean for Ghana’s economy? [5 Marks]
4.
a. The government of Ghana has gradually outlined measures to ease an opening of the economy. The government is eager to see the economy bounce back. Suppose the government approaches you as a consultant and indicates that they will like to have a very low unemployment, zero inflation and very high GDP growth. How would you advice the government? Be concise in your advice. [10 Marks]
b. Business cycles are pervasive in all macroeconomic variables. Does the relative durations of expansions and recessions help explain the fact that long-term economic growth has been positive?
In: Economics