C language <stdio.h> (Decisions only) (else if and Switch statements)
A bank wants an application to help in the loan approval process and has asked us to create it for them. Write a program to ask the user for the loan amount, the annual interest rate (as a percentage, not as a decimal), the length of the loan (in years), and the gross monthly income of the applicant. Validate the inputs per below, and if invalid, inform the user and end the program:
Loan amount must be greater than $0.00
Annual interest rate must be greater than 1.0% and less than 20.0%
Loan duration must be between 1 year and 30 years
Monthly income must be greater than $0.00
After all the inputs have been validated, calculate and display the monthly loan payment and the total interest for the loan based on the following formulas:
payment = p * r / (1 – (1 + r)-n )
total interest = n * payment – p
where:
p = the loan amount
r = monthly interest rate (annual rate / 12)
n = loan duration (in months)
Finally, determine if the applicant qualifies for the loan.
If the loan payment is less than or equal to 20.0% of the monthly income, they definitely qualify
If the loan payment is greater than 20.0% and less than or equal to 25.0% of the monthly income, it will be tight, but they qualify
If the loan payment is greater than 25.0% and less than or equal to 30.0% of the monthly income, they qualify (but the loan probably shouldn’t be approved)
If the loan payment is more than 30.0% of the monthly income, they do not qualify
Create constants for any numbers used that do not change (0, 1, 12, 20, 30, & 100) and the loan qualification levels (20.0%, 25.0%, & 30.0%), and use the constants in the validation conditions and error messages, in conversions from percentages to decimal (and vice versa) and conversions from years to months.
Display all dollar amounts with a dollar sign and 2 decimal places, and all percentages to 1 decimal place followed by a percent sign.
Example Run #1: (bold type is what is entered by the user)
Enter the amount of the loan: $100000.00
Enter the annual interest rate (8.0 = 8.0%): 4.0
Enter the length of the loan (in years): 30
Enter your monthly gross income: $3000.00
The monthly payment is: $xxx.xx (~$480.00)
The total interest is: $xxxxx.xx (~$71,870.00)
The monthly payment is less than or equal to 20.0% of your gross monthly income.
You are definitely approved for the loan!
Example Run #2:
Enter the amount of the loan: $200000.00
Enter the annual interest rate (8.0 = 8.0%): 4.0
Enter the length of the loan (in years): 30
Enter your monthly gross income: $3000.00
The monthly payment is: $xxx.xx
The total interest is: $xxxxxx.xx
The monthly payment must be less or equal to 30.0% of your gross monthly income.
I’m sorry – You do not qualify for the loan.
Example Run #3:
Enter the amount of the loan: $-50000
The mortgage amount must be greater than $0.00.
The example runs show EXACTLY how your program input and output will look.
In: Computer Science
Scenario:
Imagine you are in a strange country where people talk to you, but you do not understand what they are saying. They use strange tools to eat, and you cannot figure out how to use them. They try to feed you food you do not recognize. Sometimes these people seem friendly and caring, but at other times they become angry because you are not doing what they ask you to do. When they try to remove your clothes and take you into a room to shower you, you become frightened and upset, and you do not know what will happen next. At times, other strangers come to your room and bring gifts. They talk kindly to you, but you do not know them. They seem upset when you do not respond to their gifts and gestures. The doors and windows in this country are all locked, and you cannot find a way out so that you can go home.
a. How would you react if you were the person in this situation? Why?
b. What methods might you use to try to communicate with the person in this situation?
c. Why would the person want to go home? What does “home” mean to him or her?
d. How will this exercise help you when you care for a confused person?
In: Nursing
[The following information applies to the questions displayed below.]
Juliette formed a new business to sell sporting goods this year. The business opened its doors to customers on June 1. Determine the amount of start-up costs Juliette can immediately expense (not including the portion of the expenditures that are amortized over 180 months) this year in the following alternative scenarios: (Leave no answer blank. Enter zero if applicable.)
Problem 10-72 Part a
a. She incurred start-up costs of $2,000.
b. She incurred start-up costs of $45,000.
c. She incurred start-up costs of $53,500.
d. She incurred start-up costs of $63,000.
e. How would you answer parts (a) through (d) if she formed a partnership or a corporation and she incurred the same amount of organizational expenditures rather than start-up costs (how much of the organizational expenditures would be immediately deductible)?
In: Accounting
C++
MENU
1. ADD EMPLOYEE DETAILS
2. DELETE EMPLOYEE
3. SEARCH EMPLOYEE
4. PRINT EMPLOYEE PAYROLL
5. EXIT
EmpNo. Name Rate Hours Regular Pay Overtime Pay Gross Pay
In: Computer Science
when you need the components of the question above to grow a certain bacteria, and the bacteria grow in closed tubed in a closed dark, non-shaking incubator that is set at 54C, which definition correctly applies to these bacteria:
a. photo-heterotroph
b. halophile autotroph
c. heterotrophic thermophile
d. aerobic psychrophile
e. alkaliphilic acidophile
The answer say like this, but I can't understand about glucose. It is because of the non-shaking incubator?
In: Biology
Our weight on different planets in the solar system
will differ due to the varying size and mass of each of the
planets. Write a C program, weight.c, to compute the weight of a
200 pound person on the following planets, based on the data
below:
Planet Percent of Earth Weigh ------
------------------------
Mercury
37.8% Venus 90.7%
Mars 37.7%
Jupiter
236.0% Saturn 91.6%
Uranus 88.9%
Neptune 112.0%
The program should generate the following outputs:
Mercury: xxx.x Venus: xxx.x Mars:
xxx.x Jupiter: xxx.x Saturn: xxx.x Uranus: xxx.x
Neptune: xxx.x
Your program should right-justify the planet names and present the
output to one decimal place as shown above. Be sure to line up the
decimal points. Use the following guidelines to develop your
program:
Declare your variables with appropriate data types.
Assign values to your variables.
Perform your calculations.
Generate appropriate output.
Points to Remember:
Make sure you are creating a C program and not a C++ program. The
.c suffix to your source code will invoke the C compiler while the
.cpp suffix will invoke the C++ compile
In: Computer Science
/* Complete this javascript file according to the individual instructions given in the comments. */ // 1) Declare an array named myArray // Assign myArray three elements: 'Tuesday',3,true // Print myArray to the console with console.log() // 2) Use typeof on each element in myArray // Example: typeof myArray[0]; // Print all 3 lines to the console with console.log() // 3) Declare a variable named myStart and set it to // the value of the length property applied of myArray // Print the result to the console with console.log() // 4) Use the .splice() method on myArray // Use your variable myStart - 2 as the first parameter of .splice() // Use 0 as the second parameter // In the third parameter, specify 'hamburgers' as the element to add // Print the resulting array to the console with console.log() // 5) Declare an array named myPal // Give myPal these 4 elements: 'taco','cat','race','car' // Set a string equal the first element + the second element // Print the string to the console with console.log() // 6) Use the .concat() method to merge myArray and myPal // Print the result to the console with console.log() // 7) Use the .join() method on myPal and specify no connector parameter // Print the result to the console with console.log() // 8) Use .sort() on myArray // Print the resulting array to the console with console.log() // 9) Use .slice() on myPal and specify that it begins at // myPal.length - 2 // Print the result to the console // 10) **Solving a problem! // Declare a string named revOrder that is equal to 'Taco cat' // Utilize indexOf(), split(), splice(), reverse(), and join() to // 1) turn the string into an array // 2) locate and remove the empty space // 3) Reverse the order of the array // 4) Turn the array back into a string // 5) Log each step to the console. // Can you combine any of the steps into one statement? // You should finish with a result of "tacocaT"
In: Computer Science
One of the major component of the performance management system is the appraisal process.
talk about it.
In: Operations Management
Compare and contrast the strengths and weaknesses of the National Crime Victims Survey with those of the Uniform Crime Reports. Be specific
In: Psychology
In 500-750 words, detail the ethical standards and ethical violations of experimental psychology
Explain if anything specifically could be changed to make the studies ethical for participants.
Would you be able to replicate this study today? Why or why not?
In: Psychology
Sonia is continually concerned about whether her behaviors are socially acceptable. According to Freudian approach, what could control her personality? Explain each element in detail with relevant examples.
In: Psychology
A 0.25 kg mass sliding on a horizontal frictionless surface is attached to one end of a horizontal spring (with k = 800 N/m) whose other end is fixed. The mass has a kinetic energy of 9.0 J as it passes through its equilibrium position (the point at which the spring force is zero).
1.At what rate is the spring doing work on the mass as the mass passes through its equilibrium position?
2.At what rate is the spring doing work on the mass when the spring is compressed 0.075 m and the mass is moving away from the equilibrium position?
In: Physics
If (x> 1) && ( y <11)
Display statement
else
Display nothing
2. Suppose x is 1 and y is 10. What is the output of the following code?
If (x> 1) || ( y <11)
Display statement
Else
Display nothing
3. Write a java program that prints 1 to infinite numbers.
4. The following program is supposed to write out the integers 1, 2, 3, and 4. Decide what should go in the blanks.
public class Counter { public static void main (String[] args) { int count ; count = (blank) ; while ( count (blank) 4 ) { System.out.println( count ); count = count + (blank) ; } } }
5. The following program is supposed to write out the integers 2, 1, 0, -1 . Decide what should go in the blanks.
public class Counter3 { public static void main (String[] args) { int count ; count = (blank) ; while ( count >= (blank) ) { System.out.println( count ); count = count - (blank) ; } } }
6. The idea of a ______________ controlled loop is that there is a special value that says when the loop is done.
In: Computer Science
In: Psychology
Remarks: In all algorithm, always explain how and why they work. If not by proof, at least by a clear explanation. ALWAYS, analyze the running time complexity of your algorithms. In all algorithms, always try to get the fastest possible. A correct algorithm with a slow running time may not get full credit.
Do not write a program. Write pseudo-codes or explain in words
Question 1: Say that we want to maintain both a Queue and a Priority Queue. This means that when you do Enqueue you also add the item to the Priority Queue and when you do Dequeue you also remove the item from the Priority Queue. And vise-versa. Show how to do it.
Question 2:
1. Show how to implement a Queue by a Priority Queue. What is the run time per operation?
2. Show how to implement a Stack using Priority Queue. What is the run time per operation?
Question 3: Give a data structure that implements a Min-Heap and the command M ax(S) that returns the maximum in the heap. Try and make the last operation as fast as possible.
Question 4: Recall the problem in which you have k sorted array each of size n, which needs to make one single sorted array. Find another fast way to unite the arrays that does not use Priority Queue.
Question 5: Five an efficient data structure supporting the following operations. Insert(S, x), Delete−M ax(S), and Delete−1000 th(S) which deletes from H the 100 largest element in the structure. Assume that the number of elements is more than 100. Also assume that the numbers are pairwise distinct and so the 100"th largest element is well defined.
In: Computer Science