Questions
4 Run-time error, program crashed during execution. Not sure why you are using an array[] to...

4 Run-time error, program crashed during execution. Not sure why you are using an array[] to get input, not necessary and it seems to imply a comma separated file. The input file I provided has each data element on its own line. But it is the array[] , splittedLine, that is causing your run-time error.

code

import java.util.Scanner;

public class SalaryCalcModularized{
public static void compute(double hrlyPayRate,double hrs,String name,String shift){
// Calculate regular and overtimepay
double regularPay = Math.min(40, hrs) * hrlyPayRate;
double overtimePay = Math.max(0, hrs - 40) * 1.5 * hrlyPayRate;
System.out.println("Employee " + name);
System.out.println("Regular Pay: $" + regularPay);
System.out.println("Overtime Pay: $" + overtimePay);
System.out.println("Total Gross Pay: $" + (regularPay + overtimePay));
if (shift.equals("day")) {
System.out.println("Friday pay period");
} else {
System.out.println("Saturday pay period");
}
}
public static void read_input(){
// Scanner to read user input
Scanner obj = new Scanner(System.in);


// Prompt employee name
System.out.print("Enter Employee Name: ");
String name = obj.nextLine();
// Prompt shift
System.out.print("Enter Employee Shift: ");
String shift = obj.nextLine();
// Prompt hours worked
System.out.print("Enter hours worked: ");
double hrs = Double.parseDouble(obj.nextLine());
// Prompt payrate
System.out.print("Enter hourly pay rate: ");
double hrlyPayRate = Double.parseDouble(obj.nextLine());
compute( hrlyPayRate,hrs, name, shift);

}
  
public static void main(String[] args) {
Scanner ob=new Scanner(System.in);
String ch = "y";
while (ch.equalsIgnoreCase("y")) {
read_input();
System.out.println("Do you want continue? [Y/N]");
ch = ob.next();
ob.nextLine();
}
}

}

In: Computer Science

Write a method in JAVA to do the following: As the user to select from 2...

Write a method in JAVA to do the following:

As the user to select from 2 different (default) pokemon or load their pokemon by giving you the name of their pokemon.

Based on their selection (default or supplied name), read the move list and damage range from the input file(you do not need to create this) for the selected pokemon.

Randomly select one of the default pokemon - Bulbasaur, Charmander, Squirtle (or you can add additional computer only options if you want) and read the move list and damage range from the input file(you do not need to create this) for the selected pokemon.

Write the game loop to play your pokemon battle, which includes Your attack then computers attack and showing how much damage was done and your Pokemon's remaining hp until a winner is declared, but with the new move sets and random damage based from an outside input file.

With input file:

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class PokemonData {
   public static void main(String[] args) throws FileNotFoundException {
       Scanner sc = new Scanner(System.in);
       System.out.print("Enter pokemon name: ");
       String name = sc.nextLine();
       PrintWriter pw = new PrintWriter(new File(name+".txt"));
       int i=0;
       pw.write("Minimum Maximum\n");
       while(i<4) {
           System.out.print("Enter minimum damage of move#"+(i+1)+": ");
           int min = Integer.parseInt(sc.nextLine());
           System.out.print("Enter maximum damage of move#"+(i+1)+": ");
           int max = Integer.parseInt(sc.nextLine());
           pw.write(min +"\t\t\t"+max+"\n");
           i++;
       }
       System.out.println("Data written to the file "+name+".txt successfuly.");
       pw.close();
       sc.close();
   }
}

In: Computer Science

Dictionaries in python can store other complex data structures as the VALUE in a (KEY, VALUE)...

Dictionaries in python can store other complex data structures as the VALUE in a (KEY, VALUE) pair.

2.1) Create an empty dictionary called 'contacts'.

The KEY in this dictionary will be the name of a contact (stored as a string). The VALUE in this dictionary will be a list with three elements: the first element will be a phone number (stored as a string), the second an email address (stored as a string) and the third their age (stored as an integer).

2.2) Insert information for three imaginary contacts of yours in the dictionary contacts.

2.3) Using input(), ask the user to enter an age. Then, using a for loop and (inside the for loop) an if statement, print the name and phone number for all contacts that are either of that age or older. If no contacts of or above that age are found, your code should report that to the user. For example, suppose you have three friends in contacts with the data:

 Name:  Julia
 Phone: 384-493-4949 
 Email: [email protected] 
 Age:   34

 Name:  Alfred
 Phone: 784-094-4520 
 Email: [email protected] 
 Age:   49

 Name:  Sam
 Phone: 987-099-0932 
 Email: [email protected]
 Age:   28

Then, your code asks the user to specify a minimum age. In the example below, the user enters the age '30':

 What is the minimum age? 30

Your code should then print the name and phone number of everyone who is 30 years old or older:

 Julia is 34 years old and can be reached at 384-493-4949. 
 Alfred is 49 years old and can be reached at 784-094-4520.

If the user were to enter (for example) 50 at the prompt above, your code should have instead printed the message:

 Sorry, you do not have any contacts that are 50 or older.

In: Computer Science

ONLY FILL OUT THE TABLE AND ANSWER THE QUESTION BELOW THE TABLE Fourth workout design –...

ONLY FILL OUT THE TABLE AND ANSWER THE QUESTION BELOW THE TABLE

Fourth workout design – Knee Ligament Instability (5 points)

Your client is a 29 year-old man that tore his ACL, MCL, and medial meniscus 12 months prior while skiing. He had surgery to repair all three structures 10 months ago, and has completed 3 months of physical therapy. His goals are to continue to strengthen his hamstring muscles (physical therapy), reduce the occasional swelling and pain he has in the knee, and he would eventually like to resume skiing (with a brace).

Type of exercise

Frequency

Intensity

Time

Warm Up

Day/wk=

(min)

Cardio

Day/wk=

(lo, mod, hi)

(total min)

Cardio Exercise

Type

(% VO2max)

(min)

Muscular Endurance

Day/wk=

(lo, mod, hi)

NA

Muscular Endurance Ex 1

(exercise name)

(sets/reps)

(teaching point)

Muscular Endurance Ex 2

(exercise name)

(sets/reps)

(teaching point)

Muscular Endurance Ex 3

(exercise name)

(sets/reps)

(teaching point)

Muscular Endurance Ex 4

(exercise name)

(sets/reps)

(teaching point)

Muscular Endurance Ex 5

(exercise name)

(sets/reps)

(teaching point)

Muscular Endurance Ex 6

(exercise name)

(sets/reps)

(teaching point)

Static Stretching

Day/wk=

(lo, mod)

Min per day=

Dynamic Stretching

(lo, mod, hi)

Give a 3 to 4 sentence explanation of why you chose this workout for this client.

In: Anatomy and Physiology

9.12) How do you write a PHP script that collects the data from the form provided...

9.12) How do you write a PHP script that collects the data from the form provided below and write it to a file?

.html
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Song Survey</title>
</head>
<body>
<form method="post" action="http://localhost/lab/lab 14.php"><br />
<h3>Enter The Date</h3>
<table>
<tr>
<td>Name Of The Song:</td>
<td><input type="text" name="SongName" size="30"></td>
</tr>
<tr>
<td>Name Of The Composer:</td>
<td><input type="text" name="CName"></td>
</tr>
<tr>
<td>Name Of The Singer:</td>
<td><input type="text" name="Singer"></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>

.php
<html>
<head>
<title>Song Information</title>
</head>
<body>
<?php
$SName=$_POST["SongName"];
$CName=$_POST["CName"];
$Singer=$_POST["Singer"];
$song_file= 'song.txt';
$file_handle = fopen($song_file, 'a') or die('Cannot open file: '.$song_file);
fwrite($file_handle,$SName);
fwrite($file_handle,"#");
fwrite($file_handle,$Singer);
fwrite($file_handle,"##");
fwrite($file_handle,$CName);
fwrite($file_handle,"\r\n");
fclose($file_handle);
?>
<p>The Contents Are Written to the file <u>song.txt</u></p>
<?php
$file_handle = fopen("song.txt", "rb");
print "<h4>The Most Popular songs are.....</h4>";
while (!feof($file_handle))
{
$line_of_text = fgets($file_handle);
$parts = explode(' # ',$line_of_text);
print ("$parts[0]<br/>");
}
fclose($file_handle);
?>
</body>
</html>

In: Computer Science

complete this code for me, this is java question. // Some comments omitted for brevity import...

complete this code for me, this is java question.

// Some comments omitted for brevity

import java.util.*;

/*
* A class to demonstrate an ArrayList of Player objects
*/
public class ListOfPlayers
{
// an ArrayList of Player objects
private ArrayList players;

public ListOfPlayers()
{
// creates an empty ArrayList of Players
players = new ArrayList<>();
}

public void add3Players()
{
// adds 3 Player objects
players.add(new Player("David", 10));
players.add(new Player("Susan", 5));
players.add(new Player("Jack", 25));
}
  
public void displayPlayers()
{
// asks each Player object to display its contents
// - what if the list is empty?
for (Player currentPlayer : players)
currentPlayer.display();
}
  
// Q.4(a) for Week 8
public void clearPlayers()
{
/* Add code to clear all the Player objects from the ArrayList
* (ie. the list will be emptied after the operation)
*
* Hints:
* - display the list before AND after the operation to check
* if it was performed correctly
*/
  
// wrote your code here...
players.clear();
}

// Q.4(b) for Week 8
public void addPlayer()
{
/* Add code to ask user to input a name and a position,
* then use the data to add a new Player object into the
* players attribute.
*
* There is no need for any input validations.
*
* Hints:
* - use a Scanner to get user inputs
* - create a new Player object
* - use the add() method of the ArrayList class to add it into the list
*/
  
// wrote your code here...
}

// Q.4(c) for Week 8
public int findPlayer(String name)
{
int index = -1;
  
/* Add code to allow user to search for an existing Player object
* in players. The parameter is a string representing the name
* of the Player object to search. The return value is the index
* where the object is found, or -1 if the object is not found.
*
* Assume there are no duplate names in the list.
*
* Hints:
* - use a loop to search through the ArrayList
* - compare the given name to each Player's name in the list
* - use the indexOf() method to return the required index
*/
  
// wrote your code here...
  
return index;
}

// Q.4(d) for Week 8
public boolean updatePlayerName(int index)
{
boolean success = false;
  
/* Add code to allow user to modify an existing Player object
* in players. The parameter is the index to the Player object
* in the ArrayList. Your code should first check if the given
* index is within the correct range (between 0-max, where max
* if the ize of the list. If the index is not valid,
* or the player list is empty,
* print out an error message, otherwise ask the user to input
* a new name and update the Player object with that name.
* If the update operation is successful, return true (otherwise
* return false).
*
* Hints:
* - check if index is valid and list is not empty
* - if yes, use it to get at the correct Player in the list
* - update the Player's name
* - return the appropriate boolean result
*/

// wrote your code here...
  
return success;
}
  
// *** Pre-tute Task 1 for Week 9 ***
public boolean removePlayer(String name)
{
boolean success = false;
  
/* Add code to allow user to remove an existing Player object
* in players. The parameter is the name of the Player object
* to be removed. Your code should first check if th object
* with that name does exist.
*
* Your code *MUST* make a call to the findPlayer() method you
* wrote in Q.4(c) above.
*
* If the remove operation is successful, return true (otherwise
* return false, and print a simple error message).
*
* Hints:
* - use the findPlayer() method to find the position of the object
* - remove the Player if it exists
* - return the appropriate boolean result
*/
  
// wrote your code here...
  
return success;
}
  
// *** Pre-tute Task 2 for Week 9 ***
public boolean updatePlayerName(String oldName, String newName)
{
boolean success = false;
  
/* Add code to allow user to modify an existing Player object
* in players. This time the method takes 2 parameters: oldName
* is the name for an Player object to be searched for, newName
* is the name to update the object with. Your code should first
* check if the object with the oldName does exist.
*
* Your code *MUST* make a call to the findPlayer() method you
* wrote in Q.4(c) above.
*
* If the update operation is successful, return true (otherwise
* return false, and print a simple error message).
*
* Hints:
* - use the findPlayer() method to find the position of the object
* - update the Player's name with the given parameter (newName)
* - return the appropriate boolean result
*/
  
// wrote your code here...

return success;
}
}

In: Computer Science

JAVA LANGUAGE Required Tasks: In Eclipse, create a Java Project as CS-176L-Assign4. Create 3 Java Classes...

JAVA LANGUAGE

Required Tasks:
In Eclipse, create a Java Project as CS-176L-Assign4.
Create 3 Java Classes each in its own file Student.java, StudentList.java, and Assign4Test.java.
Copy your code from Assignment 3 into the Student.java and StudentList.java. Assign4Test.java should contain the main method.
In Student.java, add a new private variable of type Integer called graduationYear.

In Student.java, create a new public setter method setGraduationYear to set the graduationYear. The method will have one parameter of type Integer. The method will set the Student object’s graduationYear to the passed in value.

In Student.java, create a new public getter method getGraduationYear to get the graduationYear. The method will have no parameters. The method will return the Student object’s graduationYear.

In Student.java, modify the Student Class Constructor method to accept graduationYear as a parameter. Assign the initial value for the graduationYear variable in the Constructor method.

In Student.java, modify the toString method to add graduationYear to the String containing the other student info. Make sure the format of the String remains consistent.
In StudentList.java, add a new method as follows:
public boolean updateStudentGraduationYear (String email, Integer year) {...}

This method should implement the Java code to search through the studentArray to find the student based on given email. If a student is found, call the setGraduationYear method in the Student Class to update the Student’s graduation year. The return value should be true or false based on if the student was found and the graduation year updated.

In Assign4Test.java, create 3 students with graduation year 2022. Create a StudentList containing these 3 students (look at the code in Assign2Test or Assign3Test to figure out how to do this).
In Assign4Test.java, Print the info of all the Students in the StudentList using the getAllStudentInfo method. Update the graduation year of one of the Students to 2021 using the updateStudentGraduationYear method. Again print the info of all the Students in the StudentList using the getAllStudentInfo method to verify that the graduation year was updated correctly.
Code must compile and run without warnings or errors.
Final output should look something like the following:
Name: [Abdulmuhsin J. Al-Kandari], Email: [[email protected]], Major: [SE], GraduationYear: [2022]
Name: [Justin R. Schlemm], Email: [[email protected]], Major: [SE], GraduationYear: [2022]
Name: [Mary F. Menges], Email: [[email protected]], Major: [SE], GraduationYear: [2022]

Name: [Abdulmuhsin J. Al-Kandari], Email: [[email protected]], Major: [SE], GraduationYear: [2022]
Name: [Justin R. Schlemm], Email: [[email protected]], Major: [SE], GraduationYear: [2022]
Name: [Mary F. Menges], Email: [[email protected]], Major: [SE], GraduationYear: [2021]

//*******************************************************************
// Student
// This class can be used to create a Student object having a name, an email, and a major
//*******************************************************************
public class Student {
  
   private String name;
   private String email;
   private String major;
  
   public Student(String name, String email, String major){
       setName(name);
       setEmail(email);
       setMajor(major);
   }
  
   public String getName() {
       return name;
   }
  
   public void setName(String name) {
       this.name = name;
   }
  
   public String getEmail() {
       return email;
   }
  
   public void setEmail(String email) {
       this.email = email;
   }
  
   public String getMajor() {
       return major;
   }
  
   public void setMajor(String major) {
       this.major = major;
   }
  
   public String toString(){
       return "Name: [" + this.name + "], Email: [" + this.email + "], Major: [" + this.major + "]";
   }

}

//*******************************************************************
// StudentList
// This class can be used to create a StudentList object which contains an array of Student objects
//*******************************************************************
public class StudentList {
   private static final boolean StudentInfo = false;
   private Student[] studentArray;
   public String email;

   public StudentList(Student[] studentArray){
       setStudentArray(studentArray);
   }

   public Student[] getStudentArray() {
       return studentArray;
   }

   public void setStudentArray(Student[] studentArray) {
       this.studentArray = studentArray;

   }

   public int studentCount(String major) {
       int count = 0;
       for(int i=0; i<studentArray.length; i++)
       {
           if(major.equals ( studentArray[i].getMajor()))
           {
               count++;
          
               {
              
               }
           }
       }
       return count;
  
   }      
  
   public Student getStudentInfo(String email) {
       for(int i=0;i<studentArray.length; i++)
           if(studentArray[i].getEmail()==email) {
               return studentArray[i];
              
           }
       return null;
  
  
   }
  
   public String getAllStudentInfo() {
       String returnString = "";
       for (int i=0;i<studentArray.length; i++)
       {
           returnString = returnString+studentArray[i].toString()+System.lineSeparator();
       }
       return returnString;
       }
  
      
     

   public String studentInfo(String string) {
       return null;
   }

      
   }

      


In: Computer Science

The purpose of this lab is to practice using inheritance and polymorphism. We need a set of classes for an Insurance company.


The purpose of this lab is to practice using inheritance and polymorphism.    We need a set of classes for an Insurance company.   Insurance companies offer many different types of policies: car, homeowners, flood, earthquake, health, etc.    Insurance policies have a lot of data and behavior in common.   But they also have differences.   You want to build each insurance policy class so that you can reuse as much code as possible.   Avoid duplicating code.   You’ll save time, have less code to write, and you’ll reduce the likelihood of bugs.

Task I: Write a class Customer

The Customer class will describe the properties and behavior representing one customer of the insurance company.   

1. The data members should include a name, and the state the customer lives in

2. Override the equals() function.   You may consider two customers to be equal if they have the same name and live in the same state (See the Object class API if you need to know what the function prototype looks like)

3. Add any additional methods you need to complete the rest of the lab

Task I:

CODE

class Customer {

private String name, state;

public Customer(String name, String state) {

super();

this.name = name;

this.state = state;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public String getState() {

return state;

}

public void setState(String state) {

this.state = state;

}

public boolean equals(Customer other) {

if (name == null) {

if (other.name != null)

return false;

} else if (!name.equals(other.name))

return false;

if (state == null) {

if (other.state != null)

return false;

} else if (!state.equals(other.state))

return false;

return true;

}

}

Task II: Write a class InsurancePolicy

The InsurancePolicy class will describe the properties and behavior that all insurance policies have in common.   

4. The data members should include a customer name, a policy number (you can use an integer), and a policy expiration date (use LocalDate)

5. Write a constructor that takes two parameters -- the Customer name and the policy number .    Your class should not have a default constructor.

6. Write a set function that a user will use to modify the policy expiration date. 7. Write get functions for your data members

8. Write a function isExpired() that returns true if the policy has expired, false otherwise.   You can determine this by comparing the expiration date against the current date.

9. Override the toString() function (See the Object class API if you need to know what the function prototype looks like)

10. Override the equals() function.   You may consider two policies to be equal if they have the same policy number (See the Object class API if you need to know what the function prototype looks like)

Task II.

CODE

class InsurancePolicy {

private String name;

private int policyNumber;

private LocalDate expirationDate;

public InsurancePolicy(String name, int policyNumber) {

super();

this.name = name;

this.policyNumber = policyNumber;

}

public void setExpirationDate(LocalDate expirationDate) {

this.expirationDate = expirationDate;

}

public String getName() {

return name;

}

public int getPolicyNumber() {

return policyNumber;

}

public LocalDate getExpirationDate() {

return expirationDate;

}

public boolean isExpired() {

LocalDate today = LocalDate.now();

return expirationDate.compareTo(today) < 0;

}

@Override

public String toString() {

return "InsurancePolicy [name=" + name + ", policyNumber=" + policyNumber + ", expirationDate=" + expirationDate

+ "]";

}

public boolean equals(InsurancePolicy other ) {

if (expirationDate == null) {

if (other.expirationDate != null)

return false;

} else if (!expirationDate.equals(other.expirationDate))

return false;

if (name == null) {

if (other.name != null)

return false;

} else if (!name.equals(other.name))

return false;

if (policyNumber != other.policyNumber)

return false;

return true;

}

}

Task III: Write a class CarInsurancePolicy

The CarInsurancePolicy class will describe an insurance policy for a car.   

1. The data members should include all the data members of an Insurance Policy, but also the driver’s license number of the customer, whether or not the driver is considered a “good” driver (as defined by state law) , and the car being insured (this should be a reference to a Car object -- write a separate Car class for this that includes the car’s make (e.g., “Honda” or “Ford”), model (e.g. “Accord” or “Fusion”), and estimated value.

2. Write a constructor that takes two parameters -- the customer and the policy number .

3. Write the necessary get/set functions for your class.

4. Write a function calculateCost() that will return the cost of the car insurance policy .   The cost of the policy should be computed as follows: (a)   5% of the estimated car value if the driver is rated as a “good” driver, 8% of the estimated car value if the driver is not rated as a “good” driver.     (b) The cost should then be adjusted based on where the customer lives. If the customer lives in one of the high cost states of California (“CA”) or New York (“NY”), add a 10% premium to the policy cost.

public class Car {
   private String make;
   private String model;
   private double estimatedValue;

   public Car(String make, String model, double estimatedValue) {
       this.make = make;
       this.model = model;
       this.estimatedValue = estimatedValue;
   }

   public String getMake() {
       return make;
   }

   public void setMake(String make) {
       this.make = make;
   }

   public String getModel() {
       return model;
   }

   public void setModel(String model) {
       this.model = model;
   }

   public double getEstimatedValue() {
       return estimatedValue;
   }

   public void setEstimatedValue(double estimatedValue) {
       this.estimatedValue = estimatedValue;
   }

   @Override
   public String toString() {
       return "Make:" + make + "\n Model:" + model + "\nEstimated Value:"
               + estimatedValue;
   }

}
_______________________________

// CarInsurancePolicy.java

public class CarInsurancePolicy {
   private String licenceNumber;
   private boolean isGood;
   private Car car;

   public CarInsurancePolicy(String licenceNumber, boolean isGood, Car car) {
       this.licenceNumber = licenceNumber;
       this.isGood = isGood;
       this.car = car;
   }

   public String getLicenceNumber() {
       return licenceNumber;
   }

   public void setLicenceNumber(String licenceNumber) {
       this.licenceNumber = licenceNumber;
   }

   public boolean isGood() {
       return isGood;
   }

   public void setGood(boolean isGood) {
       this.isGood = isGood;
   }

   public Car getCar() {
       return car;
   }

   public void setCar(Car car) {
       this.car = car;
   }

   public double calculateCost() {
       double cost = 0;
       if (isGood) {
           return 0.05 * car.getEstimatedValue();
       } else {
           return 0.08 * car.getEstimatedValue();
       }
   }

   @Override
   public String toString() {
       return "Licence Number:" + licenceNumber
               + "\nIs Good=" + isGood + "\ncar:" + car;
   }
  

}
________________________________

// Test.java

import java.util.Scanner;

public class Test {

   public static void main(String[] args) {
       String state;

       /*
       * Creating an Scanner class object which is used to get the inputs
       * entered by the user
       */
       Scanner sc = new Scanner(System.in);

       // Getting the input entered by the user
       System.out.print("Enter Driver Licence Number :");
       String licenceNum = sc.next();
       System.out.print("Is Driver is Good ? ");
       boolean isGood = sc.nextBoolean();
       System.out.print("Enter Car make :");
       String make = sc.next();
       System.out.print("Enter Car model :");
       String model = sc.next();
       System.out.print("Enter Car value :");
       double estimatedVal = sc.nextDouble();

       System.out.print("Enter State of Customer lives in :");
       state = sc.next();

       Car c = new Car(make, model, estimatedVal);
       CarInsurancePolicy cip = new CarInsurancePolicy(licenceNum, isGood, c);

       double costOfPolicy = cip.calculateCost();
       if (state.equalsIgnoreCase("CA") || state.equalsIgnoreCase("NY")) {
           costOfPolicy += 0.10 * cip.calculateCost() + cip.calculateCost();
       }

       System.out.println(cip);
       System.out.println("Cost of Insurance Policy :$" + costOfPolicy);

   }

}

Task IV: Write tests for the Customer class and the CarInsurance classes

These tests should be put in a separate package.   

1. Make sure that you include tests for the equals() method of Customer and the calculateCost() method of CarInsurance.

Task V: Write a class HomeInsurancePolicy

The HomeInsurancePolicy class will describe an insurance policy for a home.   

2. The data members should include all the data members of an Insurance Policy, but also the estimated cost to rebuild the home, and the estimated property value

3. Write a constructor that takes two parameters -- the customer and the policy number .

4. Write the necessary get/set functions for your class.

5. Write a function calculateCost() that will return the cost of the home insurance policy .   The cost of the policy should be 0.5% of the sum of rebuild cost and the property value.    Add a 5% premium to the policy cost if the customer lives in a “high cost” state of California or New York.

Task VI: Write a class FloodInsurancePolicy

Flood insurance is a special type of homeowners insurance.   Damage caused by floods is typically not covered by a home insurance policy.   To be covered in case of a flood, homeowners need to buy a flood insurance policy.   

1. The data members should include all the data members of HomeInsurancePolicy (because this is a special type of homeowner’s insurance), but also an integer value between 1 and 99 representing the flood risk (a value of 1 will represent that the probability of a flood in the home’s area is very low, a value of 99 will represent that the home is in an area that frequently floods.   

2. Write a constructor that takes two parameters -- the customer and the policy number .

3. Write the necessary get/set functions for your class.

4. Write a function calculateCost() that will return the cost of the flood insurance policy .   The cost of the policy should be the flood risk number divided by 100 and then multiplied by the home’s rebuild cost.   Add a 7% premium to the policy cost if the customer lives in a “high cost” state of California or New York.

In: Computer Science

Note: This problem is for the 2018 tax year. Lance H. and Wanda B. Dean are...

Note: This problem is for the 2018 tax year.

Lance H. and Wanda B. Dean are married and live at 431 Yucca Drive, Santa Fe, NM 87501. Lance works for the convention bureau of the local Chamber of Commerce, while Wanda is employed part-time as a paralegal for a law firm.

During 2018, the Deans had the following receipts:

Salaries ($60,000 for Lance, $41,000 for Wanda) $101,000
Interest income—
   City of Albuquerque general purpose bonds $1,000
   Ford Motor company bonds 1,100
   Ally Bank certificate of deposit 400 2,500
Child support payments from John Allen 7,200
Annual gifts from parents 26,000
Settlement from Roadrunner Touring Company 90,000
Lottery winnings 600
Federal income tax refund (for tax year 2017) 400

Wanda was previously married to John Allen. When they divorced several years ago, Wanda was awarded custody of their two children, Penny and Kyle. (Note: Wanda has never issued a Form 8332 waiver.) Under the divorce decree, John was obligated to pay alimony and child support—the alimony payments were to terminate if Wanda remarried.

In July, while going to lunch in downtown Santa Fe, Wanda was injured by a tour bus. As the driver was clearly at fault, the owner of the bus, Roadrunner Touring Company, paid her medical expenses (including a one-week stay in a hospital). To avoid a lawsuit, Roadrunner also transferred $90,000 to her in settlement of the personal injuries she sustained.

The Deans had the following expenditures for 2018:

Medical expenses (not covered by insurance) $7,200
Taxes—
   Property taxes on personal residence $3,600
   State of New Mexico income tax (includes amount withheld
       from wages during 2018) 4,200 7,800
Interest on home mortgage (First National Bank) 6,000
Charitable contributions 3,600
Life insurance premiums (policy on Lance's life) 1,200
Contribution to traditional IRA (on Wanda's behalf) 5,000
Traffic fines 300
Contribution to the reelection campaign fund of the mayor of Santa Fe 500
Funeral expenses for Wayne Boyle 6,300

The life insurance policy was taken out by Lance several years ago and designates Wanda as the beneficiary. As a part-time employee, Wanda is excluded from coverage under her employer's pension plan. Consequently, she provides for her own retirement with a traditional IRA obtained at a local trust company. Because the mayor is a member of the local Chamber of Commerce, Lance felt compelled to make the political contribution.

The Deans' household includes the following, for whom they provide more than half of the support:

Social Security Number Birth Date
Lance Dean (age 42) 123-45-6786 12/16/1976
Wanda Dean (age 40) 123-45-6787 08/08/1978
Penny Allen (age 19) 123-45-6788 10/09/1999
Kyle Allen (age 16) 123-45-6789 05/03/2002
Wayne Boyle (age 75) 123-45-6785 06/15/1943

Penny graduated from high school on May 9, 2018, and is undecided about college. During 2018, she earned $8,500 (placed in a savings account) playing a harp in the lobby of a local hotel. Wayne is Wanda's widower father who died on January 20, 2018. For the past few years, Wayne qualified as a dependent of the Deans.

Federal income tax withheld is $4,200 (Lance) and $2,100 (Wanda). The proper amount of Social Security and Medicare tax was withheld.

Required:

Determine the Federal income tax for 2018 for the Deans on a joint return by providing the following information that would appear on Form 1040 and Schedule A. They do not want to contribute to the Presidential Election Campaign Fund. All members of the family had health care coverage for all of 2018. If an overpayment results, it is to be refunded to them.

  • Make realistic assumptions about any missing data.
  • Enter all amounts as positive numbers.
  • If an amount box does not require an entry or the answer is zero, enter "0".
  • When computing the tax liability, do not round your immediate calculations. If required round your final answers to the nearest dollar.

2. Calculate taxable gross income.

3. Calculate the total adjustments for AGI.

4. Calculate adjusted gross income.

5. Calculate the greater of the standard deduction or itemized deductions.

6. Calculate total taxable income.

7. Calculate the income tax liability.

8. Calculate the total tax credits available.

9 Calculate total withholding and tax payments.

10. Calculate the amount overpaid (refund):

11. Calculate the amount of taxes owed:

In: Accounting

Note: This problem is for the 2018 tax year. Lance H. and Wanda B. Dean are...

Note: This problem is for the 2018 tax year.

Lance H. and Wanda B. Dean are married and live at 431 Yucca Drive, Santa Fe, NM 87501. Lance works for the convention bureau of the local Chamber of Commerce, while Wanda is employed part-time as a paralegal for a law firm.

During 2018, the Deans had the following receipts:

Salaries ($60,000 for Lance, $41,000 for Wanda)

$101,000

Interest income—

   City of Albuquerque general purpose bonds

$1,000

   Ford Motor company bonds

1,100

   Ally Bank certificate of deposit

400

2,500

Child support payments from John Allen

7,200

Annual gifts from parents

26,000

Settlement from Roadrunner Touring Company

90,000

Lottery winnings

600

Federal income tax refund (for tax year 2017)

400

Wanda was previously married to John Allen. When they divorced several years ago, Wanda was awarded custody of their two children, Penny and Kyle. (Note: Wanda has never issued a Form 8332 waiver.) Under the divorce decree, John was obligated to pay alimony and child support—the alimony payments were to terminate if Wanda remarried.

In July, while going to lunch in downtown Santa Fe, Wanda was injured by a tour bus. As the driver was clearly at fault, the owner of the bus, Roadrunner Touring Company, paid her medical expenses (including a one-week stay in a hospital). To avoid a lawsuit, Roadrunner also transferred $90,000 to her in settlement of the personal injuries she sustained.

The Deans had the following expenditures for 2018:

Medical expenses (not covered by insurance)

$7,200

Taxes—

   Property taxes on personal residence

$3,600

   State of New Mexico income tax (includes amount withheld

       from wages during 2018)

4,200

7,800

Interest on home mortgage (First National Bank)

6,000

Charitable contributions

3,600

Life insurance premiums (policy on Lance's life)

1,200

Contribution to traditional IRA (on Wanda's behalf)

5,000

Traffic fines

300

Contribution to the reelection campaign fund of the mayor of Santa Fe

500

Funeral expenses for Wayne Boyle

6,300

The life insurance policy was taken out by Lance several years ago and designates Wanda as the beneficiary. As a part-time employee, Wanda is excluded from coverage under her employer's pension plan. Consequently, she provides for her own retirement with a traditional IRA obtained at a local trust company. Because the mayor is a member of the local Chamber of Commerce, Lance felt compelled to make the political contribution.

The Deans' household includes the following, for whom they provide more than half of the support:

Social Security Number

Birth Date

Lance Dean (age 42)

123-45-6786

12/16/1976

Wanda Dean (age 40)

123-45-6787

08/08/1978

Penny Allen (age 19)

123-45-6788

10/09/1999

Kyle Allen (age 16)

123-45-6789

05/03/2002

Wayne Boyle (age 75)

123-45-6785

06/15/1943

Penny graduated from high school on May 9, 2018, and is undecided about college. During 2018, she earned $8,500 (placed in a savings account) playing a harp in the lobby of a local hotel. Wayne is Wanda's widower father who died on January 20, 2018. For the past few years, Wayne qualified as a dependent of the Deans.

Federal income tax withheld is $5,200 (Lance) and $2,100 (Wanda). The proper amount of Social Security and Medicare tax was withheld.

Required:

Determine the Federal income tax for 2018 for the Deans on a joint return by providing the following information that would appear on Form 1040 and Schedule A. They do not want to contribute to the Presidential Election Campaign Fund. All members of the family had health care coverage for all of 2018. If an overpayment results, it is to be refunded to them.

·       Make realistic assumptions about any missing data.

·       Enter all amounts as positive numbers.

·       If an amount box does not require an entry or the answer is zero, enter "0".

·       When computing the tax liability, do not round your immediate calculations. If required round your final answers to the nearest dollar.

Form 1040 Tax Items

Provide the following that would be reported on Lance and Wanda Dean's Form 1040.

1. Filing status and dependents: The taxpayers' filing status:

Qualifies as the taxpayers' dependent: Select "Yes" or "No".
Penny:  

Kyle:

2. Calculate taxable gross income.
$

3. Calculate the total adjustments for AGI.
$

4. Calculate adjusted gross income.
$

5. Calculate the greater of the standard deduction or itemized deductions.
$

6. Calculate total taxable income.
$

7. Calculate the income tax liability.
$

8. Calculate the total tax credits available.
$

9 Calculate total withholding and tax payments.
$

10. Calculate the amount overpaid (refund):
$

11. Calculate the amount of taxes owed:
$

In: Accounting