Please can you draw a flow chart for the following code :
Program code for Payroll,java:
public class Payroll
{
public Payroll(String name,int ID,double payRate)
{
this.name=name;
this.ID=ID;
this.payRate=payRate;
}
private String name;
private double payRate,hrWorked;
private int ID;
public Payroll()
{
name="John Doe";
ID=9999;
payRate=15.0;
hrWorked=40;
}
public String getName()
{
return name;
}
public int getID()
{
return ID;
}
public void setPayRate(int payRate)
{
this.payRate=payRate;
}
public void setHrWorked(double hrWorked)
{
this.hrWorked=hrWorked;
}
public double getPayRate()
{
return payRate;
}
public double getHrWorked()
{
return hrWorked;
}
public double grossPay()
{
double grosspay=hrWorked*payRate;
return grosspay;
}
}
Program code for PayrollClient.java:
import java.util.Scanner;
class main
{
public static void main(String [] args)
{
Scanner read=new Scanner(System.in);
System.out.print("\nEnter Name:");
String name=read.next();
System.out.print("\nEnter ID:");
int ID=read.nextInt();
System.out.print("\nEnter Payrate:");
double payRate=read.nextDouble();
Payroll obj1=new Payroll(name,ID,payRate);
System.out.print("\nEnter Hours worked:");
double hrWorked=read.nextDouble();
obj1.setHrWorked(hrWorked);
Payroll obj2=new Payroll();
System.out.println("Employee details are:");
System.out.println("Name\t
ID\tPayRate\tHoursWorked\tGrossPay");
System.out.println(obj1.getName()+"
"+obj1.getID()+"\t"+obj1.getPayRate()+"\t"+obj1.getHrWorked()+"\t\t"+obj1.grossPay());
System.out.println(obj2.getName()+"
"+obj2.getID()+"\t"+obj2.getPayRate()+"\t"+obj2.getHrWorked()+"\t\t"+obj2.grossPay());
}
}
In: Computer Science
Complete the following tasks. In each exercise, represent your answer only in DBDL. Do not use diagrams a this point. Submit either a text file or a Word document with your work. Make sure you follow chapter 6's DBDL notation
(****** Just to clarify: this is the first question on Page
220. It says to 'produce the following reports', but what you are
asked to do is use DBDL notation to create 5 tables: Guide,
Trip, Customer, Reservation and TripGuides
Make sure to list the FK where they belong ******)
In: Computer Science
Instructions: Complete the following queries using the Colonial Adventure Tours database. You will find the description including data of this database in page 16 to page 20 in Chapter 1 in your Concepts of Database Management textbook. For each following question, create a query using the Query Design option in Access. Make sure that you save and name each query in the following manner: Query1, Query2......Query14. Query Questions:
Queries:
1. List the name of each trip that does not start in New Hampshire (NH).
2. List the last name of each guide that does not live in Massachusetts (MA).
3. List the name and start location for each trip that has the type Biking.
4. List the name of each trip that has the type Hiking and that has a distance greater than six miles.
5. List the name of each trip that has the type Paddling or that is located in Vermont (VT).
6. List the customer number, customer last name, and customer first name of each customer that lives in New Jersey (NJ), New York (NY) or Pennsylvania (PA).
7. How many trips have a type of Hiking or Biking?
8. List the trip name and state for each trip that occurs during the Summer season. Sort the results by trip name within state.
9. How many trips originate in each state?
10. How many reservations include a trip with a price that is greater than $20 but less than $75?
11. Colonial Adventure Tours calculates the total price of a trip by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservation. List the reservation ID, trip ID, customer number, and total price for all reservations where the number of persons is greater than four. Use the column name TOTAL_PRICE for the calculated field.
12. What is the average distance and the average maximum group size for each type of trip?
13. How many current reservations does Colonial Adventure Tours have and what is the total number of persons for all reservations?
In: Computer Science
Create a class called Student which stores
• the name of the student
• the grade of the student
• Write a main method that asks the user for the name of the input file and the name of the output file. Main should open the input file for reading . It should read in the first and last name of each student into the Student’s name field. It should read the grade into the grade field.
• Calculate the average of all students’ grades.
• Open the output file, for writing, and print all the students’ names on one line and the average on the next line.
• Average should only have 1 digit after the decimal
• “Average” should be left justified in a field of 15 characters. The average # should be right justified in a field of 10 spaces
Sample input:
Minnie Mouse 98.7
Bob Builder 65.8
Mickey Mouse 95.1
Popeye SailorMan 78.6
Output:
Minnie Mouse, Bob Builder, Mickey Mouse, Popeye SailorMan
Average: 84.5
How can I fix my code to get the same output
public class Student {
public static void main(String[] args)throws IOException{
Scanner k=new Scanner(System.in);
String name;
float grade;
float Average=(float) 0.0;
float sum=(float) 0.0;
System.out.println("Enter input file name:");
String input=k.nextLine();
System.out.println("Enter output file name:");
String output=k.nextLine();
PrintWriter pw = new PrintWriter("students.txt");
pw.print("Minnie Mouse 98.7\nBob Builder 65.8\nMickey Mouse
95.1\nPopeye SailorMan 78.6\n");
pw.close();
PrintWriter pw2 = new PrintWriter("students2.txt");
pw2.print("Donald Duck 77.77\nTweety Bird 55.555\nCharlie Brown
95.231\n");
pw2.close();
/* End of creating the input file */
while(k.hasNext())
{
name=k.next();
grade=k.nextFloat();
Average+=grade;
sum++;
System.out.printf("name, ", name);
}
grade=Average/sum;
System.out.printf("\n%-15s%10.1f","Average", grade);
/* test output file */
Scanner testOutput = new Scanner(new File("average.txt"));
while(testOutput.hasNext())
System.out.println(testOutput.nextLine());
/* end of test output file */
}
}
In: Computer Science
Exercise 13-22
Culver Machinery Co. manufactures equipment to a very high
standard of quality; however, it must still provide a warranty for
each unit sold, and there are instances where the machines do
require repair after they have been put into use. Culver started in
business in 2020, and as the controller, you are trying to
determine whether to use the assurance-type or service-type
warranty approach to measure the warranty obligation. You would
like to show the company president how this choice would affect the
financial statements for 2020, and advise him of the better choice,
keeping in mind that the service-type approach is consistent with
IFRS, and that there are plans to take Culver public in a few
years.
You have determined that sales on account for the year were 1,100
units, with a selling price of $3,200 each. Ignore any cost of
goods sold. The warranty is for two years, and the estimated
warranty cost averages $210 per machine. Actual costs of servicing
warranties for the year were $115,500. You have done some research
and determined that if the service-type approach were to be used,
the portion of revenue allocated to the warranty portion of the
sale would be $350. Because the costs of servicing warranties are
not incurred evenly, warranty revenues are recognized based on the
proportion of costs incurred out of the total estimated costs.
A.) For the assurance-type approach, prepare the necessary journal entries to record all of the transactions described. Payments for completed warranty repairs are paid in cash.
| Account Titles and Explanation | Debit | Credit |
| (Account Name) | ||
| (Account Name) | ||
| To record sales on account | ||
| (Account Name) | ||
| (Account Name) | ||
| To record payment of warranty expense | ||
| (Account Name) | ||
| (Account Name) | ||
| To accrue warranty expense |
Determine the warranty liability and expense amounts on the financial statements at the end of 2020.
Warranty Liability: $________
Warranty Expense: $_________
B.) For the service-type approach, prepare the necessary journal entries to record all of the transactions described.
| Account Titles and Explanation | Debit | Credit |
| (Account Name) | ||
| (Account Name) | ||
| (Account Name) | ||
| To record the sale | ||
| (Account Name) | ||
| (Account Name) | ||
| to record warranty cost incurred | ||
| (Account Name) | ||
| (Account Name) | ||
| To remeasure the unearned revenue account |
Determine the unearned revenue and expense amounts on the financial statements at the end of 2020.
Unearned Revenue: $________
Warranty Expense: $_________
(List of Possible Accounts for all parts of question: No Entry, Accounts Receivable, Materials Cash Payables, Cash, Warranty Liability, Sales Revenue, Warranty Revenue, Unearned Revenue, Warranty Expense)
In: Accounting
You can complete this with Eclipse (or BlueJ if you like). Here are the requirements:
Write a Person class. A Person has properties of name and age. You construct a Person object by providing the name and age in that order. We want to be able to get and set the name. We want to be able to get the age and to increase the age by 1 when the person has a birthday.
What will the object need to remember? name and age - those are the instance variables.
Person class has this constructor :
public Person (String theName, int theAge) - Constructs a new person with the given name and age. Remember that the job of the constructor is to initialize the instance variables
It has these methods.
public String getName() - Gets the name of this Person
public int getAge() - Gets the age of this Person
public void setName(String newName) - Sets the new name for this Person
public void haveBirthday() - Adds one to this Person's age
The methods and constructor are provided as stubs in the starter file. A stub has a method header and a body with no implementation.
The stub for an accessor returns 0 for numbers or null for objects like strings.
A stub for a mutator method has no body at all.
A class with stubs for methods will compile, but it does not yet behave correctly. You still need to supply implementation and the correct return values. The idea is that you can implement one method at a time and test it since the class will compile. This technique is frequently used in development of applications.
Javadoc is also provided for this class. Study how it is done so you can write the required Javadoc in the next problem. Notice that the Javadoc says what the method will do when complete - not what the stub does.
You are given a PersonTester class along with the starter for the Person class. Copy both into your BlueJ project. PersonTester is an application with a main method. To run your application, right click on it and execute its main method.
Given code:
public class Person
{
/**
* Constructs a new person with the given
name and age
* @param theName the name of this Person
object
* @param theAge the age of this Person
object
*/
public Person (String theName, int theAge)
{
}
/**
* Gets the name of this Person
* @return the name of this person
*/
public String getName()
{
return null;
}
/**
* Gets the age of this Person
* @return this presons age
*/
public int getAge()
{
return 0;
}
/**
* Sets the new name for this Person
* @param newName the new name for this
Person
*/
public void setName(String newName)
{
}
/**
* Adds one to this Person's age
*/
public void haveBirthday()
{
}
}
In: Computer Science
find all the errors c++
should be able to be compiled and run to perform the task
#include iostream
#include <string>
Using namespace std;
class Customer {
// Constructor
void Customer(string name, string address) : cust_name(name), cust_address(address)
{
acct_number = this.getNextAcctNumber();
}
// Accessor to get the account number
const int getAcctNumber() { return acct_number; }
// Accessor to get the customer name
string getCustName(} const { return cust_name; }
// Accessor to get the customer address
string getCustAddress() const { return cust_address; }
// Set a customer name and address
static void set(string name, string address);
// Set a customer address
void setAddress(string cust_address) { cust_address = cust_address; }
// Get the next account number for the next customer.
static const unsigned long getNextAcctNumber() { ++nextAcctNum; }
// input operator
friend Customer operator>> (istream& ins, Customer cust);
// output operator
friend void operator<< (const ostream& outs, const Customer &cust) const;
private
string cust_name; // customer name
unsigned long acct_number; // account number
string cust_address; // customer address
static const unsigned long nextAcctNum;
};
const int MAX_CUSTOMERS=20; // Change this to a smaller number to test.
// Declare the class variable nextAcctNum
unsigned long Customer::nextAcctNum=10000;
// set the customer name and address
// @param name: the customer name
// @param address: the account address
void Customer::set(string name, string address) : cust_name(name), cust_address(address)
{
}
// input operator reads customer as a name and address on two separate lines.
// name
// address1
friend Customer Customer::operator>>(istream& ins, Customer cust)
{
getline(cin, cust.cust_name);
getline(cin, cust.cust_address);
return *this;
}
// output operator
friend void Customer::operator<<(const ostream& out, const Customer& cust) const
{
out << acct_number << “: “ << cust_name << “\n“ << cust_address << endl;
}
int main()
{
Customer custList[MAX_CUSTOMERS];
cout << “Enter the customer list one per line\n”;
// Read in customer list.
for (int i = 0; i < MAX_CUSTOMERS; i++)
{
cin >> custList[i];
}
// Get customer address changes
for (int i = 0; i < MAX_CUSTOMERS; i++)
{
int answer;
cout << “Address change for “ << custList.acct_number[i] << “? (y or n) : “;
cin >> answer;
if (answer == ‘y’) {
cin >> input;
custList.setAddress[i] = input;
}
}
‘
// Write out customer list.
for (int i = 0; I < MAX_CUSTOMERS; i++)
{
cout << custList[i];
}
return 0;
}In: Computer Science
Capital Structure of Ford Motor Company between 2016-2019 and how is their performance.
In: Finance
Calculate Tesla INC.'s WACC for fiscal years 2017, 2016, 2015.
In: Finance
Prepare a Balanced Scorecard for The Ford Motor Company from the 2016 fiscal year.
In: Accounting