Acquire the first name of the applicant. Use the applicant’s name in the required prompts to show that you are a friendly bank.
Prompt the customer to enter the percentage of his/her down payment which is a double value. Note if the percentage is 23.4%, the customer will enter “23.4” without the percentage sign.
If the customer can NOT put at least 15% down, reject the application.
If the customer can put 15% or more as the down payment, prompt the customer to enter his/her credit score which is supposed to be an integer.
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
Name your file HomeLoanApproval.java
In: Computer Science
Hi, someone please do every part. I'm desperate!! :(
Using RStudio, Create an R-Script:
(1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed().
(2) Change the diagonal elements of tmp to 1s.
(3) Calculate condition number of tmp. See help for cond().
(4) Calculate the inverse of tmp. See help for solve().
(5) Calculate the trace of tmp.
(6) Sort tmp across rows.
(7) Delete the last row and last column from tmp and name the submatrix as tmp again.
(8) Reshape tmp as 40 by 10 matrix and name it as tmp1.
(9) Repeat tmp1 four times to generate 40 by 40 array, and name it as tmp2.
(10) Calculate condition number of tmp2.
(11) Calculate the inverse of tmp2.
(12) Change all nonpositive (<= 0) elements of tmp2 to 0.5.
(13) Set the first row and first column element of tmp2 to its negative value.
(14) Now take the natural log of tmp2 and name it as tmp3.
(15) Find the indices for NaN values in tmp3.
In: Statistics and Probability
(Round the final answer to 4 decimal digits) 1. A brand name has a 70% recognition rate. Assume the owner f the brand wants to verify that rate by begging with a small sample of 6 randomly select consumers. a. What is the probability that exactly 4 of the selected consumers recognize the brand name?
b. What is the probability that all of the selected consumers recognize the brand name?
c. What is the probability that at least 5 of the selected consumers recognize the brand name?
d. What is the probability that at most 2 of the selected consumers recognize the brand name?
2) . The lengths of pregnancies are normally distributed with a mean of 272 days and a standard deviation of 15 days. If 35 women are randomly selected, find the probability that they have a mean pregnancy between 271 days and 275 days.
3) The body temperatures of adults are normally distributed with a mean of 98.6° F and a standard deviation of 0.50° F. If 25 adults are randomly selected, find the probability that their mean body temperature is greater than 98.4° F.
4) The average number of pounds of red meat a person consumes each year is 190 with a standard deviation of 24 pounds (Source: American Dietetic Association). If a sample of 60 individuals is randomly selected, find the probability that the mean of the sample will be Less than 192 pounds.
In: Statistics and Probability
JAVA
(1) Create two files to submit:
Build the Payroll class with the following specifications:
(2) In main(), create two Payroll objects: one use the info
inputted by the user, and the other use the default constructor,
and print the info for each employee (2 pts)
Ex:
Enter the name, ID, pay rate, and hours worked of an employee: Linda Smith 1234 20.5 35 Employee Records: Name ID Pay Rate Hrs Worked Gross Pay Linda Smith 1234 $20.50/hr 35.0 $717.50 John Doe 9999 $15.00/hr 40.0 $600.00
In: Computer Science
Write a complete and
syntactically correct Python program to solve the following
problem:
Write a program for your professor that allows him to keep a record
of the students’ average grade in his class. The program must be
written in accordance with the following specs:
1. The input must be interactive from the keyboard. You will take
input for 12 students.
2. You will input the students’ name and an average grade. The student cannot enter an average below zero or above 100. Your program must raise and handle an exception should this occur.
a. The exception should cause the program to return and get a new grade
3. Write all output to a file named grades.txt
4. Close the output file.
5. Open the file grades.txt for input.
6. Your program will raise and handle an exception if the file is not found.
a. I will
test this aspect by changing the file name and looking for your
exception
code (your exception should cause program to ask for correct file
name).
7. Read all the records from the file and display them.
Please help me to finish this code:
name,grade=input().split()
grade=int(grade)
if grade <0 or grade>100:
exceptioncheck()
def execptioncheck():
name,grade=input().split()
In: Computer Science
Required:
Use the following information to complete Armando and Lourdes Gonzales’s 2016 federal income tax return. If information is missing, use reasonable assumptions to fill in the gaps.
You may need the following forms and schedules to complete the project: Form 1040, Schedule A, Schedule B, Schedule C, Schedule D, Schedule E, Schedule SE, Form 2106-EZ, Form 4562 (for the dental practice), Form 4562 (for the rental property), Form 4797, Form 8863, Form 8949.
Facts:
Armando Z. and Lourdes K. Gonzales are married and file a joint return. Armando is self-employed as a dentist, and Lourdes is a college professor. Armando and Lourdes have three children. The oldest is Ricardo, who lives at home. Ricardo is a law student at the University of Cincinnati and worked part time during the year, earning $1,500, which he spent for his own support. Armando and Lourdes provided $6,000 toward Ricardo’s support (including $4,000 for Ricardo’s fall tuition). They also provided over half the support of their daughter, Selena, who is a full-time student at Edgecliff College in Cincinnati. Selena worked part time as an independent contractor during the year, earning $3,200. Selena lived at home until she was married in December 2016. She filed a joint return with her husband, Tony, who earned $20,000 during the year. Felipe is the youngest and lived in the Gonzales’s home for the entire year. The Gonzaleses provide you with the following additional information:
Armando and Lourdes would like to take advantage on their return of any educational expenses paid for their children.
The Gonzaleses do not want to contribute to the presidential election campaign.
The Gonzaleses live at 621 Franklin Avenue, Cincinnati, Ohio 45211.
Armando’s birthday is 3/5/1958 and his Social Security number is 333-45-6666.
Lourdes’s birthday is 4/24/1961 and her Social Security number is 566-77-8888.
Ricardo’s birthday is 11/6/1993 and his Social Security number is 576-18-7928.
Selena’s birthday is 2/1/1997 and her Social Security number is 575-92-4321.
Felipe’s birthday is 12/12/2004 and his Social Security number is 613-97-8465.
The Gonzaleses do not have any foreign bank accounts or trusts.
Lourdes is a lecturer at Xavier University in Cincinnati, where she earned $30,000. The university withheld federal income tax of $3,375, state income tax of $900, Cincinnati city income tax of $375, $1,860 of Social Security tax, and $435 of Medicare tax. She also worked part of the year for Delta Airlines. Delta paid her $10,000 in salary, and withheld federal income tax of $1,125, state income tax of $300, Cincinnati city income tax of $125, Social Security tax of $620, and Medicare tax of $145.
The Gonzaleses received $800 of interest from State Savings Bank on a joint account. They received interest of $1,000 on City of Cincinnati bonds they bought in January with the proceeds of a loan from Third National Bank of Cincinnati. They paid interest of $1,100 on the loan. Armando received a dividend of $540 on General Bicycle Corporation stock he owns. Lourdes received a dividend of $390 on Acme Clothing Corporation stock she owns. Armando and Lourdes received a dividend of $865 on jointly owned stock in Maple Company. All of the dividends received in 2016 are qualified dividends.
Armando practices under the name “Armando Z. Gonzales, DDS.” His business is located at 645 West Avenue, Cincinnati, Ohio 45211, and his employer identification number is 01-2222222. Armando’s gross receipts during the year were $111,000. Armando uses the cash method of accounting for his business. Armando’s business expenses are as follows:
Advertising $ 1,200
Professional dues 490
Professional journals 360
Contributions to employee benefit plans 2,000
Malpractice insurance 3,200
Fine for overbilling State of Ohio for work performed on welfare patient 5,000
Insurance on office contents 720
Interest on money borrowed to refurbish office 600
Accounting services 2,100
Miscellaneous office expense 388
Office rent 12,000
Dental supplies 7,672
Utilities and telephone 3,360
Wages 30,000
Payroll taxes 2,400
In June, Armando decided to refurbish his office. This project was completed and the assets placed in service on July 1. Armando’s expenditures included $8,000 for new office furniture, $6,000 for new dental equipment (seven-year recovery period), and $2,000 for a new computer. Armando elected to compute his cost recovery allowance using MACRS. He did not elect to use §179 immediate expensing, and he chose to not claim any bonus depreciation.
Lourdes’s mother, Maria, died on July 2, 2011, leaving Lourdes her entire estate. Included in the estate was Maria’s residence (325 Oak Street, Cincinnati, Ohio 45211). Maria’s basis in the residence was $30,000. The fair market value of the residence on July 2, 2011, was $155,000. The property was distributed to Lourdes on January 1, 2012. The Gonzaleses have held the property as rental property and have managed it themselves. From 2012 until June 30, 2016, they rented the house to the same tenant. The tenant was transferred to a branch office in California and moved out at the end of June. Since they did not want to bother finding a new tenant, Armando and Lourdes sold the house on June 30, 2016. They received $140,000 for the house and land ($15,000 for the land and $125,000 for the house), less a 6 percent commission charged by the broker. They had depreciated the house using the MACRS rules and conventions applicable to residential real estate. To compute depreciation on the house, the Gonzaleses had allocated $15,000 of the property’s basis to the land on which the house is located. The Gonzaleses collected rent of $1,000 a month during the six months the house was occupied during the year. They incurred the following related expenses during this period:
Property insurance $500
Property taxes 800
Maintenance 465
Depreciation (to be computed) ?
The Gonzaleses sold 200 shares of Capp Corporation stock on September 3, 2016, for $42 a share (minus a $50 commission). The Gonzaleses received the stock from Armando’s father on June 25, 1980, as a wedding present. Armando’s father originally purchased the stock for $10 per share on January 1, 1968. The stock was valued at $14.50 per share on the date of the gift. No gift tax was paid on the gift.
Lourdes is required by Xavier University to visit several high schools in the Cincinnati area to evaluate Xavier University students who are doing their practice teaching. However, she is not reimbursed for the expenses she incurs in doing this. During the spring semester (January through April 2016), she drove her personal automobile 6,800 miles in fulfilling this obligation. Lourdes drove an additional 6,700 personal miles during 2016. She has been using the car since June 30, 2015. Lourdes uses the standard mileage method to calculate her car expenses.
Armando and Lourdes have given you a file containing the following receipts for expenditures during the year:
Prescription medicine and drugs (net of insurance reimbursement) $ 376
Doctor and hospital bills (net of insurance reimbursement) 2,468
Penalty for underpayment of last year’s state income tax 15
Real estate taxes on personal residence 4,762
Interest on home mortgage (paid to Home State Savings & Loan) 8,250
Interest on credit cards (consumer purchases) 595
Cash contribution to St. Matthew’s church 3,080
Payroll deductions for Lourdes’s contributions to the United Way 150
Professional dues (Lourdes) 325
Professional subscriptions (Lourdes) 245
Fee for preparation of 2015 tax return paid April 12, 2016 500
The Gonzaleses filed their 2015 federal, state, and local returns on April 12, 2016. They paid the following additional 2015 taxes with their returns: federal income taxes of $630, state income taxes of $250, and city income taxes of $75.
The Gonzaleses made timely estimated federal income tax payments of $1,500 each quarter during 2016. They also made estimated state income tax payments of $300 each quarter and estimated city income tax payments of $160 each quarter. The Gonzaleses made all fourth-quarter payments on December 31, 2016. They would like to receive a refund for any overpayments.
Armando and Lourdes have qualifying insurance for purposes of the Affordable Care Act (ACA).
In: Accounting
Below are four bivariate data sets and the scatter plot for each. (Note that each scatter plot is displayed on the same scale.) Each data set is made up of sample values drawn from a population.
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
Answer the following questions. The same response may be the correct answer for more than one question.
|
In: Statistics and Probability
Data Analysis & Visualization
Topic R vector and save the r code in a text file
Problem 1.
Create two vectors named v and w
with the following contents:
v : 21,10,32,2,-3,4,5,6,7,4,-22
w : -18,72,11,-9,10,2,34,-5,18,9,2
A) Print the length of the vectors
B) Print all elements of the vectors
C) Print elements at indices 3 through 7.
D) Print the sum of the elements in each vector.
E) Find the mean of each vector. (Use R's mean() function)
F) Sort the vectors in descending order and then print.
G) Add vectors v and w.
H) Multiply vectors v and w.
I) In vector v select all elements that are greater than
zero.
J) In vector w select all elements that are less than zero.
K) Multiply each element of vector v by 6. And then print.
L) Find maximum and minimum of each vector.
M) In each vector, replace all negative values with the average of
all numbers in the vector.
Problem 2.
Write a for loop to print the numbers 100, 98, 96, . . . , 4, 2.
Problem 3.
Create a data frame with the following content:
|
city |
county |
state |
population |
|
Chicago |
Cook |
IL |
2853114 |
|
Kenosha |
Kenosha |
WI |
90352 |
|
Aurora |
Kane |
IL |
171782 |
|
Elgin |
Kane |
IL |
94487 |
|
Gary |
Lake(IN) |
IN |
102746 |
|
Joliet |
Kendall |
IL |
106221 |
|
Naperville |
DuPage |
IL |
147779 |
|
Arlington Heights |
Cook |
IL |
76031 |
|
Bolingbrook |
Will |
IL |
70834 |
|
Cicero |
Cook |
IL |
72616 |
|
Evanston |
Cook |
IL |
74239 |
|
Hammond |
Lake(IN) |
IN |
83048 |
|
Palatine |
Cook |
IL |
67232 |
|
Schaumburg |
Cook |
IL |
75386 |
|
Skokie |
Cook |
IL |
63348 |
|
Waukegan |
Lake(IL) |
IL |
91452 |
Hint: Create vectors for each column and then
create a data frame using vectors and the data.frame() function. A
sample is given in the lecture notes.
city<-
c("Chicago","Kenosha","Aurora","Elgin","Gary","Joliet","Naperville","Arlington
Heights","Bolingbrook","Cicero","Evanston","Hammond","Palatine","Schaumburg","Skokie","Waukegan")
county<- c( "Cook", "Kenosha", "Kane", "Kane", "Lake(IN)",
"Kendall", "DuPage", "Cook", "Will", "Cook", "Cook", "Lake(IN)",
"Cook", "Cook", "Cook", "Lake(IL)")
state<- c( "IL", "WI", "IL", "IL", "IN", "IL", "IL", "IL", "IL", "IL", "IL", "IN", "IL", "IL", "IL", "IL")
population<-c(2853114,90352,171782,94487,102746,106221,147779,76031,70834,72616,74239,83048,67232,75386,63348,91452)
A) Print the mean of population.
B) Print the population of all cities greater than 800,000.
C) Print city, county,state and population of all cities with population less than 1,000,000.
D) Print city, county, state, and population of the most crowded city.
Hint: You can use subset() function with max() in your selection criteria in the subset() function.Then print the data in the subset.
E) Print the city and state of the least crowded city.
Hint: You can use subset() function with min() in your selection criteria in the subset() function. Then print the data in the subset.
In: Computer Science
INPUT FILE INTO ARRAY. CHECKING FOR COMMAS AND SUCH. HOW TO DO?
void readFile(Candidate candidates[]) – reads the elections.txt file, fills the candidates[] array. Hint: use substr() and find() functions. Set Score to 0.
void List(Candidate candidates[]) – prints the array of Candidate
structs. One candidate per one line, include all fields. Use setw()
to display nice looking list.
void displayCandidate(Candidate candidates[]) – prints the complete
information about the candidate
.
Candidate First(Candidate candidates[]) – returns single struct
element: candidate with highest score
Candidate Last(Candidate candidates[]) – returns single struct
element: candidate with lowest score
void Votes(Candidate candidates[]) – function sorts the
candidates[] array by number of votes, the order in candidates[]
array is replaced
void Scores(Candidate candidates[]) – calculates the percentage
score for each candidate. Use the following formula:
??????=(CandidateVotes)/(sum of votes)*100%
Correct line for the reference: F=John,L=Smith,V=3342
The line errors that your program needs to detect, are as follows:
incorrect token / separator, example in line 5: F=Steven,L=JohnV=4429 --- (comma missing) – lines with this error need to be ignored
space in token, example in line 3: F=Hillary,X=Clinton, V=1622 --- lines with this error need to be read, error fixed, data included in your dataset
empty line, example in line 6 – empty lines need to be ignored
Example Textfile
F=Michael,L=John,V=3342
F=Danny,L=Red,V=2003
F=Hillary,L=Clinton, V=1588
F=Albert,L=Lee,V=5332
F=Steven,L=JohnV=4429
*IMPORTANT* How would I do the readFile function? It says to check if the commas are present, and that the program will correct the line if there is white spaces. How do i use the find() function? Please be DETAILED in explanations of each part of code. Beginner Coder. *IMPORTANT*
Code Skeleton We HAVE to follow:
#include
#include
#include
#include
#include
using namespace std;
struct Candidate {
string Fname;
string Lname;
int votes;
double Score;
};
const int MAX_SIZE = 100;
void readFile(Candidate[]);
void List(Candidate[]);
void Votes(Candidate[]);
void displayCandidate(Candidate);
Candidate First(Candidate[]);
Candidate Last(Candidate[]);
void Scores(Candidate[]);
int main() {
}
void readFile(Candidate candidates[]) {
string line;
ifstream infile;
infile.open("elections.txt");
while (!infile.eof()) {
getline(infile,line);
// your code here
}
infile.close();
}
void List(Candidate candidates[]) {
}
void Votes(Candidate candidates[]) {
}
void displayCandidate(Candidate candidates) {
}
Candidate First(Candidate candidates[]) {
}
Candidate Last(Candidate candidates[]) {
}
void Scores(Candidate candidates[]) {
}
TO ANUNAGA: I don't know what you want, this is the code we HAVE TO go by and code by and figure out. I can't give you anymore information. Please, either help me solve this or just don't.
In: Computer Science
INPUT FILE INTO ARRAY. CHECKING FOR COMMAS AND SUCH. PLEASE READ CAREFULLY.
alot of people give me either partial answers, or incorrect skeleton. PLEASE YOU CAN'T CHANGE WHAT IS THERE, YOU CAN ONLY ADD.
void readFile(Candidate candidates[]) – reads the elections.txt file, fills the candidates[] array. Hint: use substr() and find() functions. Set Score to 0.
void List(Candidate candidates[]) – prints the array of Candidate
structs. One candidate per one line, include all fields. Use setw()
to display nice looking list.
void displayCandidate(Candidate candidates[]) – prints the complete
information about the candidate
.
Candidate First(Candidate candidates[]) – returns single struct
element: candidate with highest score
Candidate Last(Candidate candidates[]) – returns single struct
element: candidate with lowest score
void Votes(Candidate candidates[]) – function sorts the
candidates[] array by number of votes, the order in candidates[]
array is replaced
void Scores(Candidate candidates[]) – calculates the percentage
score for each candidate. Use the following formula:
??????=(CandidateVotes)/(sum of votes)*100%
Correct line for the reference: F=John,L=Smith,V=3342
The line errors that your program needs to detect, are as follows:
incorrect token / separator, example in line 5: F=Steven,L=JohnV=4429 --- (comma missing) – lines with this error need to be ignored
space in token, example in line 3: F=Hillary,X=Clinton, V=1622 --- lines with this error need to be read, error fixed, data included in your dataset
empty line, example in line 6 – empty lines need to be ignored
Example Textfile
F=Michael,L=John,V=3342
F=Danny,L=Red,V=2003
F=Hillary,L=Clinton, V=1588
F=Albert,L=Lee,V=5332
F=Steven,L=JohnV=4429
*IMPORTANT* Please be DETAILED in explanations of each part of code. Beginner Coder. *IMPORTANT*
Code Skeleton We ***HAVE*** to follow. How Would i go about using this skeleton? YOU CANNOT CHANGE FUNCTIONS OF VARIABLES, ***BUT YOU MAY ADD TO IT***. THE CODE MUST HAVE WHAT IS LISTED IN THE SKELETON CODE:
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <fstream>
#include <string>
using namespace std;
struct Candidate {
string Fname;
string Lname;
int votes;
double Score;
};
const int MAX_SIZE = 100;
void readFile(Candidate[]);
void List(Candidate[]);
void Votes(Candidate[]);
void displayCandidate(Candidate);
Candidate First(Candidate[]);
Candidate Last(Candidate[]);
void Scores(Candidate[]);
int main() {
}
void readFile(Candidate candidates[]) {
string line;
ifstream infile;
infile.open("elections.txt");
while (!infile.eof()) {
getline(infile,line);
// your code here
}
infile.close();
}
void List(Candidate candidates[]) {
}
void Votes(Candidate candidates[]) {
}
void displayCandidate(Candidate candidates) {
}
Candidate First(Candidate candidates[]) {
}
Candidate Last(Candidate candidates[]) {
}
void Scores(Candidate candidates[]) {
}
In: Computer Science