Design two sub- classes of Employee...SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An hourly employee has an hourly pay rate attribute, an hours worked attribute, and an earnings attribute. An hourly employee that works more than 40 hours gets paid at 1.5 times their hourly pay rate. You will decide how to implement constructors, getters, setters, and any other methods that might be necessary.
1. (20 points) Draw a UML diagram for the classes.
2. (80 points) Implement the classes, and write a test program that creates a salaried employee and two hourly employees. One of the hourly employees should have hours worked set to less than 40 and one should have hours worked set to more than 40.
The test program should display all attributes for the three employees. To keep things simple, the employee classes don’t need to do any editing.
I really need help with the first part of this question regarding the UML.
In: Computer Science
The second assignment involves writing a Python program to
compute the price of a theater ticket. Your program should prompt
the user for the patron's age and whether the movie is 3D. Children
and seniors should receive a discounted price. There should be a
surcharge for movies that are 3D. You should decide on the age
cutoffs for children and seniors and the prices for the three
different age groups. You should also decide on the amount of the
surcharge for 3D movies. Your program should output the ticket
price for the movie ticket based on the age entered and whether the
movie is in 3D.
Your program should include the pseudocode used for your design in
the comments. Document the values you chose for the age cutoffs for
children and seniors, the prices for the three different age groups
and the surcharge for 3D movies in your comments as well.
You are to submit your Python program as a text file (.txt) file.
In addition, you are also to submit a test report in a Word
document or a .pdf file. 15% of your grade will be based on whether
the comments in your program include the pseudocode and define the
values of your constants, 70% on whether your program executes
correctly on all test cases and 15% on the completeness of your
test report.
In: Computer Science
Im trying to create a book list. I started off like this but idk how to continue?
public static int [] BookList (String title, String author, int price, int copies, String category) {
}
I don't know what to do next in order to list a set of (lets say 5 ) books and how to call it in the main (public static void main(String[] args))method
In: Computer Science
Use a while(true) loop to ask the user the following 2 values
“Enter a rate r =” “Enter a nonnegative integer (enter negative
integer to quit):”
If the user enters a negative int for n, the while loop is broken
via the brake statement. Otherwise,
in the remaining part of the while loop, use a for loop to compute
the partial sum for the geometric
series, namely 1 + r + rˆ2 + rˆ3 + . . . +rˆn.
Use the iomanip library in order to print the sum with 50 decimal
digits of precision.
Sample output:
Enter a rate r = 4
Enter a non-negative integer (enter negative integer to quit):
9
1 + 4^1 + 4^2 + 4^3 + 4^4 + 4^5 + 4^6 + 4^7 + 4^8 + 4^9 =
349525
Enter a rate r = 0
Enter a non-negative integer (enter negative integer to quit):
3
1 + 0^1 + 0^2 + 0^3 = 1
Enter a rate r = -4
Enter a non-negative integer (enter negative integer to quit):
-2
C++
Will like if correct,thank you.
In: Computer Science
Exercises
4. Using the IDE make a new project/program by changing SmallIO.java so that integers instead of Strings are entered by the user.
5. Change the program so that it only loops until the number -999 is entered by the user.
6. Modify the last program so that it (a) keeps and displays a running total and the average so far of the entered numbers (b) displays the largest and the smallest numbers so far of the entered numbers.
NOTE: PART 4 AND 5 HAS BEEN DONE. IN PART 6a TOTAL HAS BEEN DONE YOU HAVE TO CALCULATE AVERAGE AND DO PART B. BELOW IS THE PROGRAM CONTINUE DOING IT FROM WHERE I LEFT. THANKS
package tutorial1;
import java.util.Scanner;
/**
*
* @author ML
*/
public class Tutorial1 {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int a = 0; // initialise to empty string
int total = 0;
while (a != -999){
//an infinite loop, use Ctrl-C to quit
System.out.println("Enter a line:"); //prompt
a= keyboard.nextInt(); ///accepts an integer
System.out.println("Your number: " + a);
//method caLLS
total = totalaverage(a, total);
System.out.println("Your total is: " + total);
System.out.println(); // print a blank line
} //end of while
}//end of main
// keeps and displays a running total and the average so far of the
entered numbers
public static int totalaverage(int a, int total)
{
return total + a ;
}
}
In: Computer Science
Compose a research report on Bar Codes vs. RFID. You
work as an efficiency analyst at one of the largest retail
companies in the world, with multiple stores in every state, as
well as in many other countries. For the past 25 years, the company
has used bar code readers at checkout counters that scan the bar
code on products to determine from a database the price to charge
customers and to keep a record of inventory. The company is
considering replacing the bar codes and bar code readers with RFID.
Analyze and discuss the impact such a change would have on the
company, its suppliers, and its customers. Include in your
discussion any security risks.
Find two examples of RFID readers and compare prices, user reviews,
and features. Are handheld options for RFID readers
available for store clerks to use on the store floor or for
customer checkout? Compile your findings. List the advantages and
disadvantages of implementing RFID. Include information about
reliability and costs.
In: Computer Science
Your task is to create a book ordering form using VISUAL STUDIOS, with the code and screenshots
1. Boxes for first name, last name, address.
2. Radio buttons to select: hard cover, soft cover, ebook.
3. Drop down list to select the book (make up three or four book names).
4. Radio buttons to select credit card (at least Visa, Master Card, American Express).
5. Box to enter credit card numbers.
6. The credit card box MUST verify that numbers are entered only. It will display error information and make the user enter the information agaion.
7. All items will be checked to make sure the user entered something, or selected something. If something is missing an error message must be displayed.
Once the user clicks the submit button, the following happens:
A total price is determined by looking at the book selected, and the type of book selected.
If the book is hardback, the price is $50, softback $40, ebook $30.
Add 10% sales tax.
Display the book name, book type, and total cost back to the user. Also thank them for the order.
Make everything user friendly by including labels, and text to explain what to do and what to enter into boxes.
In: Computer Science
Write a subroutine that will receive a char input
value. This subroutine should then use a switch statement to
determine if the char is a vowel, consonant, digit, or other type
of character.
Write the subroutine only,
This is in C++
In: Computer Science
Use a while(true) loop to ask the user the following 2 values
“Enter a value x “ “Enter a nonnegative integer n (enter negative
integer to quit): “
If the user enters a negative int for n, the while loop is broken
via the brake statement. Otherwise,
in the remaining part of the while loop, use a for loop to compute
the partial sum for the Riemann
zeta series for the geometric series, namely 1 + 2ˆ-x + 3ˆ-x + . .
. + nˆ-x.
Use the iomanip library in order to print the sum with 50 decimal
digits of precision.
Use the cmath library in order to access the pow function. For
example pow(3,-x) returns the value
of 3ˆ-x.
Sample output:
Enter a value x = 5
Enter a non-negative integer (enter negative integer to quit):
4
1 + 2^-5 + 3^-5 + 4^-5 =
1.0363417888374486519609263268648646771907806396484
Enter a value x = -5
Enter a non-negative integer (enter negative integer to quit):
4
1 + 2^5 + 3^5 + 4^5 = 1300
Enter a value x = 6
Enter a non-negative integer (enter negative integer to quit):
-2
C++.will like if correct,thank you.
In: Computer Science
Define a java problem with user input, user output, Do While Statement and some mathematical computation. Write the pseudocode, code and display output.
In: Computer Science
Truth table for NAND function |
||
i1 |
i2 |
output |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
In: Computer Science
In: Computer Science
JAVA
Lab Assignment #13: Looping Lab with both types of loops.
Lab 13 Part a:
Using a While Loop, write the code that does the following:
Lab 13 Part b:
Using a Do While Loop, write the code that does the following:
Include the following in your programs:
NOTE 1:
NOTE 2:
1. Declare all variables within the data declaration section of
each class and method. (-.1)
2 Do not get input on the same line as a variable
declaration. (-.1)
3. Do not place an equation for computation on the same line as
declaring a variable. (-.1)
3. Do not place an equation for computation on the
same line as an input
statement. (-.1)
In: Computer Science
Given a graph G = (V,E), the source-sink pair (s,t) and capacity of edges {C_e ≥ 0 | e ∈ E}, design a polynomial-time algorithm to find a set of edges S, such that for every edge e ∈ S, increasing C_e will lead to an increase of max-flow value between s and t. Show the correctness of your algorithm.
In: Computer Science
In: Computer Science