Create an abstract class Employee. Your Employee class should include the following attributes:
First name (string)
Last name (string)
Employee id (string)
Employee home street address (string)
Employee home city (string)
Employee home state (string)
Write a constructor to initialize the above Employee attributes. Create an abstract method called earnings. Create another class HourlyEmployee that inherits from the abstract Employee class. HourEmployee must use the inherited parent class variables and add in attributes HourlyRate and HoursWorked. Your HourEmployee class should contain a constructor that calls the constructor from the Employee class to initialize the common instance variables but also initializes the HourlyRate and HoursWorked. Implement the Employee abstract earnings method in HourlyEmployee to calculate the earnings for a week. Note that earnings is hourly rate * hours worked.
Create a test class that prompts the user for the information for two hourly employees, creates the 2 two hourly employees objects, calls the earnings method then displays the attributes and earnings for each of the two hourly.
SUBMIT YOUR JAVA CODE AND PSUEDOCODE
In: Computer Science
8.14 LAB: Warm up: Contacts (C Programming Only)
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
(1) Create three files to submit.
(2) Build the ContactNode struct per the following specifications:
Ex. of PrintContactNode() output:
Name: Roxanne Hughes Phone number: 443-555-2864
(3) In main(), prompt the user for three contacts and output the
user's input. Create three ContactNodes and use the nodes to build
a linked list. (2 pts)
Ex:
Person 1 Enter name: Roxanne Hughes Enter phone number: 443-555-2864 You entered: Roxanne Hughes, 443-555-2864 Person 2 Enter name: Juan Alberto Jr. Enter phone number: 410-555-9385 You entered: Juan Alberto Jr., 410-555-9385 Person 3 Enter name: Rachel Phillips Enter phone number: 310-555-6610 You entered: Rachel Phillips, 310-555-6610
(4) Output the linked list. (2 pts)
Ex:
CONTACT LIST Name: Roxanne Hughes Phone number: 443-555-2864 Name: Juan Alberto Jr. Phone number: 410-555-9385 Name: Rachel Phillips Phone number: 310-555-6610
In: Computer Science
Chapter 20, programming challenge 2: Linked List Sorting and Reversing
Modify the LinkedList1 class presented in this chapter by adding sort() and reverse() methods. The reverse method reverses the order of the elements in the list, and the sort method rearranges the elements in the list so they are sorted in alphabetical order. Do not use recursion to implement either of these operations. Extend the graphical interface in the LinkedListDemo class to support sort and reverse commands, and use it to test the new methods.
This must be done in java (netbeans)
In: Computer Science
foreach(int i ______ intArr)
In: Computer Science
Question 12 PYTHON:
Write a function named first_last that takes a single parameter,
string_list (a list of strings). The
function first_last should return a list of the strings in
string_list that are not empty and that begin
and end with the same letter.
For example, the following would be correct input and output for the function first_last.
response = ['to', 'that', 'I', 'say', '', 'hurrah']
print(first_last(response))
['that', 'I', 'hurrah']
Question 13 (20 points)
Write a function named number_luck. The function number_luck takes two parameters:
1. lucky, a list of lucky numbers between 2 and 12,
inclusive
2. unlucky, a list of unlucky numbers between 2 and 12,
inclusive
Every number is either lucky, unlucky or boring (neither lucky nor unlucky).
The function number_luck should
1. ask the user for a number in the range 2 to 12 (you may
assume that the user provides valid
input)
2. print a message echoing the user’s number and stating whether it
is lucky, unlucky or boring
3. return an integer that is the user’s number
For example, the following would be correct input and output.
>>> a_num = number_luck([7, 11], [2, 3, 12])
Give me a number from 2 to 12: 7
7 is lucky. You win!
>>> print(a_num)
7
In: Computer Science
Which areas of the network would a college IT staff most likely NOT have to redesign as a direct result of many students bringing their own tablets to school to access school resources? And explain the function of each design (choose 4) (1pt each correct ans. + 3 pts. for each explanation)?
Extranet:
Intranet:
Wired LAN:
Wireless LAN:
Wireless WAN:
In: Computer Science
(C++)Problem #1: Coin Tossing Simulation: Write a program that simulates coin tossing. Let the program prompt the user to enter the number of tosses N and count the number of times each side of the coin appears. Print the results. The program should call a separate function flip() that takes no arguments and returns 0 for tails and 1 for heads. The program should produce different results for each run.
Sample Input / Output
Enter the number of tosses N: 1000
The total number of Heads is: 495
The total number of Tails is: 505
In: Computer Science
PLEASE MAKE UP ANY 3 NONLINEAR PROGRAMMING PROBLEMs BY YOUR OWN AND SOLVE IT in either EXCEL, matlab or lingo.
In: Computer Science
Sign up for an API Key to consume OpenWeathermap.org and using their Weather API, using Bootstrap, axios, jQuery create an application that returns weather information for a given Zip Code (see https://openweathermap.org/current#zip), I.e. a form with a zip code input and button that when i click the button it returns the weather information on the DOM.
Even extra points if you handle the loading state so that the user is aware something is loading.
You can use https://getbootstrap.com/docs/4.4/getting-started/introduction/#starter-template as a starting point
In: Computer Science
Code Using Arrays in Java
There is a new ruling for the only elevator located at Block B. Students who need to ride the elevator, must line up in a queue. The rated load in pounds for the elevator is based on the inside net platform areas. The maximum load for the elevator is 500 pound.
Write a program to read the students weight (in pound) in the line and calculate the number of students that are allowed to enter the elevator before it makes a loud noise.
Input
The first line of input is T (1 ≤ T ≤ 100) which is the number of test case. This is followed by T lines of input. Each line starts with X (X ≤ 100) which is the number of students who want to ride the elevator. This is then followed by a list of X data which is the students’ weight in the line.
Output
For each test case, the output contains a line in the format "Case #x: y", where x is the case number (starting from 1) and y indicates the number of students in the line that are allowed to ride the elevator.
Sample Input
3 9 45 25 50 46 10 55 50 83 68 5 66 155 93 101 90 8 64 70 50 45 85 74 110 95
Sample Output
Case #1: 9 Case #2: 4 Case #3: 7
In: Computer Science
I am wanting to know how to write guessing game program in java that prompts the use to enter a capital for a each of 50 states, one state at a time. Upon receiving the user input, the program reports whether the answer is correct or incorrect. Assume 50 states and their capitals are stored in a two-dimensional array. Attached is a copy of the two-dimensional array that can be copied into your program. The user's answer is not case sensitive.
Sample run:
What is the capital of Alabama? Phoenix
Your answer is incorrect.
What is the capital of Alaska? Juneau
Your answer is correct.
What is the capital of Arizona? phoenix
Your answer is correct.
statecapitals.txt
String[][] stateCapital = {
{"Alabama", "Montgomery"},
{"Alaska", "Juneau"},
{"Arizona", "Phoenix"},
{"Arkansas", "Little Rock"},
{"California", "Sacramento"},
{"Colorado", "Denver"},
{"Connecticut", "Hartford"},
{"Delaware", "Dover"},
{"Florida", "Tallahassee"},
{"Georgia", "Atlanta"},
{"Hawaii", "Honolulu"},
{"Idaho", "Boise"},
{"Illinois", "Springfield"},
{"Indiana", "Indianapolis"},
{"Iowa", "Des Moines"},
{"Kansas", "Topeka"},
{"Kentucky", "Frankfort"},
{"Louisiana", "Baton Rouge"},
{"Maine", "Augusta"},
{"Maryland", "Annapolis"},
{"Massachusettes", "Boston"},
{"Michigan", "Lansing"},
{"Minnesota", "Saint Paul"},
{"Mississippi", "Jackson"},
{"Missouri", "Jefferson City"},
{"Montana", "Helena"},
{"Nebraska", "Lincoln"},
{"Nevada", "Carson City"},
{"New Hampshire", "Concord"},
{"New Jersey", "Trenton"},
{"New York", "Albany"},
{"New Mexico", "Santa Fe"},
{"North Carolina", "Raleigh"},
{"North Dakota", "Bismarck"},
{"Ohio", "Columbus"},
{"Oklahoma", "Oklahoma City"},
{"Oregon", "Salem"},
{"Pennsylvania", "Harrisburg"},
{"Rhode Island", "Providence"},
{"South Carolina", "Columbia"},
{"South Dakota", "Pierre"},
{"Tennessee", "Nashville"},
{"Texas", "Austin"},
{"Utah", "Salt Lake City"},
{"Vermont", "Montpelier"},
{"Virginia", "Richmond"},
{"Washington", "Olympia"},
{"West Virginia", "Charleston"},
{"Wisconsin", "Madison"},
{"Wyoming", "Cheyenne"}
};In: Computer Science
Create a JUNIT test program in Java for this program:
package edu.odu.cs.cs350;
import java.util.Arrays;
/**
* A duration represents a period of elapsed time, e.g., 4 hours, 23 minutes, 2 seconds.
* This is differentiated from a point in time (e.g., 4:23:02AM). A meeting that
* has a duration of 2 hours has that same duration no matter where it was held. A
* starting time (point) for that of 2:00PM EST can be unambiguous only if the time
* zone is added.
*
* <p>
* Because durations are often used in calculations, both positive and
* negative values are possible.
*
* <p>
* Most of the accessor functions for this class will respond with normalized
* values, where the normalization rules are as follows:
* <ul>
* <li>The seconds and minutes components will have an absolute
* value in the range 0..59, inclusive.</li>
* <li>The hours component will have an absolute value in the
* range 0..23, inclusive.</li>
* <li>The sign of each component matches the sign of the
* overall duration. A duration of -61 seconds, for example,
* has normalized components of -1 seconds and -1 minutes.</li>
* </ul>
* Inputs to the member functions are not, however, required to
* be normalized. new Duration(0,0,3,-61) and new Duration(0,0,1,59)
* are both acceptable (and the resulting Duration objects are equal).
*
* @author zeil
*
*/
public class Duration implements Cloneable {
/**
* Construct a new duration, equivalent to
* Duration(0,0,0,0).
*/
public Duration() {
//ToDo
}
/**
* Create a new duration.
*
* @param totalSeconds total number of seconds in duration
*/
public Duration(long totalSeconds) {
//ToDo
}
/**
* Create a new duration.
*
* @param days number of days in duration
* @param hours number of hours in duration
* @param minutes number of minutes in duration
* @param seconds number of seconds in duration
*/
public Duration(int days, int hours, int minutes, int seconds) {
//ToDo
}
/**
* Get the total seconds of this duration, including the contributions
* of the days, hours, minutes, & seconds components.
*
* @return the total seconds
*/
public long getTotalSeconds() {
//ToDo
return 0;
}
/**
* Set the total seconds of this duration, potentially altering
* the days, hours, minutes, & seconds components.
* @param totalSeconds the total seconds to set
*/
public void setTotalSeconds(long totalSeconds) {
//ToDo
}
/**
* How many days in this duration?.
*
* @return the normalized days component
*/
public int getDays() {
//ToDo
return 0;
}
private static final long secondsPerHour = 60 * 60;
/**
* How many hours in this duration?.
*
* @return the normalized hours component
*/
public int getHours() {
//ToDo
return 0;
}
/**
* How many minutes in this duration?.
*
* @return the normalized minutes component
*/
public int getMinutes() {
//ToDo
return 0;
}
/**
* How many seconds in this duration?.
*
* @return the normalized seconds component
*/
public int getSeconds() {
//ToDo
return 0;
}
/**
* Add another duration to this one.
* @param dur a duration
*/
public void add(Duration dur) {
//ToDo
}
/**
* Subtract another duration from this one.
* @param dur a duration
*/
public void subtract(Duration dur) {
//ToDo
}
/**
* Multiply this duration by a scaling factor,
* rounding to the closest second.
* @param factor a scaling factor
*/
public void scale(double factor) {
//ToDo
}
/**
* Render the duration as
* d:h:m:s
* (preceded by a '-'if the duration is negative)
* where the four components are normalized non-negative
* integer values. The final three components are always rendered
* in 2 digits. The two leading components and their
* associated ':' delimiters are omitted if the leading values
* are zero. E.g., Duration(0,-1,-59,-61) would be rendered as
* "-02:00:01".
*/
public String toString() {
//ToDo
return "";
}
// Comparison and hashing
/**
* Compares two durations for equality. They are considered equal if
* their getTotalSeconds() values are equal.
*
* @param obj object to be compared for equality with this duration
* @return <tt>true</tt> if the specified object is equal to this one
*/
public boolean equals(Object obj) {
//ToDo
return false;
}
/**
* Returns the hash code value for this object.
*
* @return the hash code value for this duration
*/
public int hashCode() {
//ToDo
return 0;
}
/**
* Return a (deep) copy of this object.
*/
@Override
public Object clone() {
//ToDo
return null;
}
}
*This is the template to fill in for the solution - please fill in these functions to complete the JUNIT Test Class*
/**
*
*/
package edu.odu.cs.cs350;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author Colten Everitt
*
*/
public class DurationClassTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws
Exception {
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#hashCode()}.
*/
@Test
public final void testHashCode() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#Duration()}.
*/
@Test
public final void testDuration() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#Duration(long)}.
*/
@Test
public final void testDurationLong() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#Duration(int, int, int, int)}.
*/
@Test
public final void testDurationIntIntIntInt() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#getTotalSeconds()}.
*/
@Test
public final void testGetTotalSeconds() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#setTotalSeconds(long)}.
*/
@Test
public final void testSetTotalSeconds() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#getDays()}.
*/
@Test
public final void testGetDays() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#getHours()}.
*/
@Test
public final void testGetHours() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#getMinutes()}.
*/
@Test
public final void testGetMinutes() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#getSeconds()}.
*/
@Test
public final void testGetSeconds() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#add(edu.odu.cs.cs350.Duration)}.
*/
@Test
public final void testAdd() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#subtract(edu.odu.cs.cs350.Duration)}.
*/
@Test
public final void testSubtract() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#scale(double)}.
*/
@Test
public final void testScale() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#toString()}.
*/
@Test
public final void testToString() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#equals(java.lang.Object)}.
*/
@Test
public final void testEqualsObject() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
edu.odu.cs.cs350.Duration#clone()}.
*/
@Test
public final void testClone() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#Object()}.
*/
@Test
public final void testObject() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#getClass()}.
*/
@Test
public final void testGetClass() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#equals(java.lang.Object)}.
*/
@Test
public final void testEqualsObject1() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#clone()}.
*/
@Test
public final void testClone1() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#toString()}.
*/
@Test
public final void testToString1() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#notify()}.
*/
@Test
public final void testNotify() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#notifyAll()}.
*/
@Test
public final void testNotifyAll() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#wait(long)}.
*/
@Test
public final void testWaitLong() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link java.lang.Object#wait(long,
int)}.
*/
@Test
public final void testWaitLongInt() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#wait()}.
*/
@Test
public final void testWait() {
fail("Not yet implemented"); //
TODO
}
/**
* Test method for {@link
java.lang.Object#finalize()}.
*/
@Test
public final void testFinalize() {
fail("Not yet implemented"); //
TODO
}
}
In: Computer Science
Hints:
You will need to pick a port for the server – something over 1024.
Ensure that you open your firewall to let the signal through.
In: Computer Science
7. Using the provided schema of a Purchase Order Administration database, write the following queries in SQL. (In the schema, bold attributes are primary keys and italicized attributes are foreign keys.)
SUPPLIER (SUPNR, SUPNAME, SUPADDRESS, SUPCITY, SUPSTATUS)
SUPPLIES (SUPNR, PRODNR, PURCHASE_PRICE, DELIV_PERIOD)
PRODUCT (PRODNR, PRODNAME, PRODTYPE, AVAILABLE_QUANTITY)
PO_LINE (PONR, PRODNR, QUANTITY)
PURCHASE_ORDER (PONR, PODATE, SUPNR)
7d) Write a nested SQL query to retrieve the supplier number, supplier name, and supplier status of each supplier who has a higher supplier status than supplier number 21.
7e) Write a nested SQL query using the keyword IN to retrieve the supplier name of each supplier who supplies more than five products.
In: Computer Science
Discuss best practices for evaluating the performance and effectiveness of the IT governance structure. What should IT managers consider when evaluating the effectiveness of the IT governance structure? Provide an example of a best practice and how it is relevant to the strategic vision of your organization, or an organization you are familiar w
In: Computer Science