NEED FAST
Consider a scenario in which a realty company uses a ranking system of values from 0-6 to determine realtor commission percentage and homeowner net sale proceeds. Create the code for java appllication that prompts the user for the realtor ranking and the home sale price. Use the ranking to determine the commission percentage based on the table below, ten calculate the commission cost and net homeowner proceeds ( sale price - commission) in dollars. The code must run multiple test cases of rankings and home sales prices one execution. Use an array or arrays to store the input values. Assume rankings are only 0 to 6 inclusive. The employee ranking must be greater than or equal to zero and less than 7. If less than zero or greater than 6, reprompt for a valid value. Code should have statements to output the calculated commission and homeowner proceeds for each case.
Ranking Commission %
0 0.5
1 1.25
2 3.0
3 4.5
4 6.25
5 6.75
6 7
7 3
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class Commission
{
int rank;
float sale_price;
Commission(int r, float s)
{
this.rank = r;
this.sale_price = s;
}
float calculate()
{
int check = rank;
float final_price;
if(check == 0){
final_price = (float)(sale_price - (sale_price * 0.005));
}
else if (check == 1)
{
final_price = (float)(sale_price - (sale_price *0.0125));
}
else if (check == 2)
{
final_price =(float) (sale_price - (sale_price * 0.030));
}
else if (check == 3)
{
final_price =(float) (sale_price - (sale_price * 0.045));
}
else if (check == 4)
{
final_price =(float) (sale_price - (sale_price * 0.0625));
}
else if (check == 5)
{
final_price = (float)(sale_price - (sale_price *0.07));
}
else
{
final_price =(float) (sale_price - (sale_price *0.03));
}
return final_price;
}
public static void main (String[] args)
{
Scanner input = new Scanner(System.in);
int rank[]=new int[1];
int check = 0 ;
int flag = 0;
while(flag == 0)
{
System.out.println("please enter your rank");
check = input.nextInt();
if((check < 0)&&(check
> 7))
flag = 0;
else
flag = 1;
}
rank[0] = check;
System.out.println("enter the sale price");
float sale = input.nextFloat();
Commission c = new
Commission(check,sale);
float final_price =
c.calculate();
System.out.println("Fianl price is
:" + final_price);
}
}
NEED FAST Consider a scenario in which a realty company uses a ranking system of values...
A method called linearSearch(), which takes as parameters an array of int followed by three values of type int, and returns a value of type int. The first int parameter represents a key, the second int parameter represents a starting position, and the third int parameter represents an end position. If the key occurs in the array between the start position (inclusive) and the end position (exclusive), the method returns the position of the first occurrence of the key in...
do
it using MATLAB plz and fast plaz full work
1. The residents of Bikini Bottom are ranked on a toughness scale from 0-100. If a resident's toughness number is 45 or less, they have to eat at Super Weenie Hut Junior. If a resident's toughness number is between 45 and 90 (including 90). they have to eat at Weenie Hut Junior. Those with a toughness number greater than 90 can eat at the Salty Spitoon. Write a program which...
IN php .... I need Help I Need to Modify this application so it uses a persistent session to save the last values entered by the user for 5 minutes. At the top of the file (before the DOCTYPE html line) you will need to add a section of code which checks to see if a session id exists. If it does not, the code you add (which will be similar to the example on page 359) will need to...
Please answer the questions correctly ASAP. It's multiple
choice.
1)
2)
3)
Which of the following values of the Condition Code (N Z P) could occur in the LC-3 to indicate that the value written to the register file is less than or equal to zero? [You must check all that apply to get credit.] 000 001 011 100 101 110 111 Which of the following instructions overwrite the Condition Code? [You must check all that apply to get credit.]...
IN C++ PROGRAMMING (We use #include <iostream> and cout and cin) Shipping Calculator Speedy Shipping Company will ship your package based on the weight and how far you are sending the package, which can be anywhere in the world. They will only ship small packages up to 10 pounds. You need to have a program, which will help you determine how much they will charge. The charges are based on each 500 miles shipped. The mileage should be in whole...
Consider the following C++ program. It prints a small table containing sin and cos values from 0 to 360 degrees. #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int step = 20; cout << setw(10) << "degrees" << setw(10) << "cos" << setw(10) << "sin" << endl; for (int degrees = 0; degrees <= 360; degrees += step) { cout << setw(10) << degrees << setw(10) << setprecision(5) << fixed << cos(degrees) << setw(10) << setprecision(5)...
Ques) Write a program in c, which meets the following
requirements.
Requirements 1. Read integer values from stdin, separated by one or more spaces or newlines, until reaching EOF 2. The input is guaranteed to be well-formed. 3. The input contains no more than 80 values. 4. on standard output, render a simple vertical column graph representation of the input values, in order left to right, using hash'#' characters as shown in the examples below. The number of hashes printed...
Your goal is to create an ‘Array’ class that is able to hold
multiple integer values. The ‘Array’ class will be given
functionality through the use of various overloaded operators
You will be given the main() function for your program and must add
code in order to achieve the desired result. Do not change any code
in main(). If something is not working, you must change your own
code, not the code in main().
Assignment 5: overloading member functions. Overview:...