Questions
Create a table called product containing a product number, company name, model number, product name. What...

Create a table called product containing a product number, company name, model number, product name. What is my primary key? Which datatypes should I use? Please submit a printout of the commands used for creating the above table and the results of your queries/commands.

PLEASE USE JAVA & H2DATABASE

In: Computer Science

JAVA PROGRAMMING Part 1 Create a class Student, with attributes id, first name, last name. (All...

JAVA PROGRAMMING

Part 1

  1. Create a class Student, with attributes id, first name, last name. (All the attributes must be String)
    1. Create a constructor that accepts first name and last name to create a student object.
    2. Create appropriate getters and setters
  2. Create another class StudentOperationClient, that contains a main program. This is the place where the student objects are created and other activities are performed.
  • In the main program, create student objects, with the following first and last names.
  • Chris Evans
  • Mila Kunis
  • Adam Sandler
  • Emma Watson
  • Jennifer Lawrence
  • Dwayne Johnson.
  • Once you create the student objects, use System.out.println, function to print the values in following format:
  • First Name: XXXXXX , Last Name: XXXXXXXX

Part 2

3.       Create an integer attribute to student class, name it as studentScore. No getters and setters are needed for this attribute.

4.       When you create the Student object using the constructor, assign a random number to score attribute – random number should be between, 50 and 100.

5.       Create a new method in Student object, called getGrade(), that returns a String.

a.       The output method should return the following

If the score is >91, the return should be A,

Likewise B for >81 , C > 71, D > 61, and F for all others.

6.       Modify the StudentOperationsClient’s main program, to print the following.

First Name: XXXXXX , Last Name: XXXXXXXX    Letter Grade: XX

Part 3

  1. Perform the steps 2, and 6, using arrays in Java. So instead of 6 different objects, you will create an array of 6 student objects and iterate them using a for loop.
  2. Create a new method in student, getGradeDescription() – that returns a string and takes a String as input.

Use switch case control statements to return the following,

  • A – Excellent
  • B – Fair
  • C – Average
  • D – Poor
  • F – Fail,

•&νβσπ;&νβσπ;&νβσπ;&νβσπ;&νβσπ;&νβσπ;&νβσπ;&νβσπ; and any other input as “INVALID”

  • Once you create the student objects in the ARRAY, use System.out.println, function to print the values in following format:

First Name: XXXXXX , Last Name: XXXXXXXX Class Performance: <GradeDescription>

In: Computer Science

IN JAVA Step 1 Develop the following interface: Interface Name: ImprovedStackInterface Access Modifier: public Methods Name:...

IN JAVA

Step 1 Develop the following interface: Interface Name: ImprovedStackInterface Access Modifier: public Methods Name: push Access modifier: public Parameters: item (data type T, parameterized type) Return type: void Throws: StackFullException Name: push Access modifier: public Parameters: item1 (data type T, parameterized type), item2 (data type T, parameterized type) Return type: void Throws: StackFullException Name: pop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Name: doublePop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Name: top Access modifier: public Parameters: none Return type: T (parameterized type) Throws: StackEmptyException Step 2 Develop the following class: Class Name: StackFullException Access Modifier: public Extends: Exception Constructors Name: StackFullException Access modifier: public Parameters: none (default constructor) Task: makes a call to the default constructor of its superclass Name: StackFullException Access modifier: public Parameters: message (datatype String) Task: makes a call to the constructor of its superclass by passing the parameter message to it Step 3 Develop the following class: Class Name: StackEmptyException Access Modifier: public Extends: Exception Constructors Name: StackEmptyException Access modifier: public Parameters: none (default constructor) Task: makes a call to the default constructor of its superclass Name: StackEmptyException Access modifier: public Parameters: message (datatype String) Task: makes a call to the constructor of its superclass by passing the parameter message to it Step 4 Develop the following class: Class Name: ImprovedArrayBasedStack Access Modifier: public Implements: ImprovedStackInterface Instance variables Name: top Access modifier: private Data type: int Name: stack Access modifier: private Data type: T[] (an array of parameterized type) Constructors Name: ImprovedArrayBasedStack Access modifier: public Parameters: none (default constructor) Task: sets the value of top to -1 sets the stack to refer to an array of Objects with 100 elements which are type cast to T[] Name: ImprovedArrayBasedStack Access modifier: public Parameters: size (data type int) Task: sets the value of top to -1 sets the stack to refer to an array of Objects with the number of elements equal to the size parameter which are type cast to T[] Methods Name: push Access modifier: public Parameters: item (data type T, parameterized type) Return type: void Throws: StackFullException Task: if the value of top is less than the length of the stack minus 1 then increase the value of top by 1 and place the item at the top of the stack, otherwise throw a StackFullException with the message "Not enough room for one item" Name: push Access modifier: public Parameters: item1 (data type T, parameterized type), item2 (data type T, parameterized type) Return type: void Throws: StackFullException Task: if the value of top is less than the length of the stack minus 2, then increase the value of top by 1 and place item1 at the top of the stack, then increase the value of top by 1 and place item2 at the top of the stack, otherwise throw a StackFullException with the message "Not enough room for two items" Name: pop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Task: if the value of top is greater than -1 then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, otherwise throw a StackEmptyException with the message "No item to remove" Name: doublePop Access modifier: public Parameters: none Return type: void Throws: StackEmptyException Task: if the value of top is greater than 0, then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, then remove the item at the top of the stack by replacing it with null and decrease the value of top by 1, otherwise throw a StackEmptyException with the message "There are less than two items in the stack" Name: top Access modifier: public Parameters: none Return type: T (parameterized type) Throws: StackEmptyException Task: if the value of top is greater than -1 then return the item at the top of the stack, otherwise throw a StackEmptyException with the message "Top attempted on an empty stack" Step 5 Develop a class with only a main method in it: import java.util.Scanner; public class ImprovedStackDemo { public static void main(String[] args) { /* Inside of this main method do the following: Create an object of the Scanner class that takes input from System.in and refer to this object as keyboard Create a reference to a ImprovedStackInterface called myImprovedStack and have it refer to a new object of the ImprovedArrayBasedStack type passing the value of 6 as an argument to the constructor Open a do/while loop Prompt the user to pick one of the following options: Press 1 to push one item onto the stack Press 2 to push two items onto the stack Press 3 to pop the top of stack Press 4 to pop the top of the stack twice Press 5 to look at the top of the stack Press 6 to end the program Save the user’s input into the option variable if the user picks option 1, prompt the user for what they would like to push onto the stack then save that in a variable called item Open a try block and inside that block call the push method by passing item as a parameter and then close the try block Open a catch block catching StackFullException e and inside this catch block print out the value of message stored in the exception else if the user picks option 2, prompt the user for what they would like to push onto the stack then save that in a variable called item1 Prompt the user for the second item that they would like to push onto the stack and save that in a variable called item2 Open a try block and inside that block call the push method by passing item1 and item 2 as parameters and then close the try block Open a catch block catching StackFullException e and inside this catch block print out the value of the message stored in the exception else if the user picks option 3, Open a try block and call the pop method and close the try block Open a catch block catching StackEmptyException e and inside this catch block print out the value of the message stored in the exception else if the user picks option 4, Open a try block and call the doublePop method and close the try block Open a catch block catching StackEmptyException e and inside this catch block print out the value of the message stored in the exception else if the user picks option 5, Open a try block and print the value returned by the top method and close the try block Open a catch block catching StackEmptyException e and inside this catch block print out the value of the message stored in the exception else if the user picks option 6, display Goodbye. else if the user picks any other option, display Error! close the do/while loop and make it so that it continues to run as long as the user does not pick option 6 */ } }

In: Computer Science

I need SQL queries for these statements 17. Display the contracts and payment methods associated with...

I need SQL queries for these statements

17. Display the contracts and payment methods associated with each referral Patient Last Name, Physician Last Name, Referral Start Date, Contract Start Date, Payment Method Sort Order: Payment Method - ascending Physician Last Name – ascending Patient Last Name – ascending Referral Start Date – ascending Contract Start Date – ascending

18. Display the number of contracts whose payment method is Insurance Number of contracts (This is a single value)

19. Display the number of contracts whose payment method is Insurance, broken out by Insurance Company Insurance Company Name, number of contracts Sort order: Insurance company name

20. List the Employees who are Nurses Employee First Name, followed by a space, followed by Employee Middle Initial, followed by a space, followed by Employee Last Name (call this whole field “Nurses”)

21. Display the average hourly wage for all employees who are aides. Average hourly wage (single value)

22. Display the average hourly wage for all hourly employees broken out by level. Skill level, average wage Sort order: Skill Level

23. Display the total salary for all salaried employees. Total salaries (single value)

In: Computer Science

In Angel, you will find a class called Employee. This class should include a constructor which...

In Angel, you will find a class called Employee. This class should include a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class should include methods to set the name and salary and return the name and salary. Create another method to return the name and salary nicely formatted as a string (hint – research the toString method).

You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toStringthat prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class.

You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered.

Your program should be able to handle a maximum of 3 entries.

You may write the program as a console application or using dialog boxes.

please answer this by creating a code for a java eclipse. Make sure the code runs smoothly. Also post screen shots of it running

In: Computer Science

Perl is a programming language that can be used on Linux. Write a Perl shell script...

Perl is a programming language that can be used on Linux.

Write a Perl shell script named phone.pl that prompts the user to enter first or last or any portion of person’s name, so that can be found the appropriate entry in the phone directory file called “phones”.

If the user tries to enter name as the argument on the command line, he/she will get a warning message “You need to provide name when prompted by this script!”

If the person’s entry does NOT exist in the file “phones” then it will be displayed the following message “Name NOT found in the phone directory file!” (where Name is the user’s input).

A text file list of names and information similar to the final output of sample run #2 has been provided by the teacher.

Sample Run #1:

INPUT: $ perl phone.pl Chad

OUTPUT: You need to provide name when prompted by this script!

Sample Run #2:

INPUT 1: $ perl phone.pl

OUTPUT 1: Enter a name to search for:

INPUT 2: Chad

OUTPUT 2: Brockman, Chad 920-213-0043 [email protected]

Sample Run #3:

INPUT 1: $ perl phone.pl

OUTPUT 1: Enter a name to search for:

INPUT 2: User

OUTPUT 2: User not found in the phone directory file

In: Computer Science

Create your own data. Ensure the data will test all criteria and prove all sorts worked...

Create your own data. Ensure the data will test all criteria and prove all sorts worked as required. Be sure that all tables and queries have descriptive names. “Query 1” and “Step 1” are examples of poor names.

Step 1

Build a Database named DBMS Course Project. The database should include the following tables:

  • First Table – Students
    • ID
    • First Name
    • Last Name
    • Address
    • City
    • State
    • Zip Code
    • Phone Number with area code
  • Second Table – GPA
    • ID Current GPA (two decimal positions)
    • Class (numeric field, 1 = Freshman, 2 = Sophomore, etc.)
      • Freshman
      • Sophomore
      • Junior
      • Senior
      • Graduate Student
  • Third Table – Scholarships
    • ID
    • Major course of study
    • Academic Scholarship (Use Yes/No data type)
    • Athletic Scholarship (Use Yes/No data type)

Step 2

Extract the First and Last Name, Address, City, State, Zip Code and Phone Number of each Senior on the database. Sort by Last Name, then First Name (1 sort).

Step 3

Extract the First and Last Name, and GPA of each student who qualifies for the Dean’s List. Sort by GPA, then Last Name, then First Name (1 sort). A GPA of 3.25 is required to make the Dean’s List.

In: Computer Science

you will find a class called Employee. This class should include a constructor that sets name...

you will find a class called Employee. This class should include a constructor that sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class should include methods to set the name and salary and return the name and salary. Create another method to return the name and salary nicely formatted as a string (hint – research the toString method). You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toString that prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class. You will then create a test class that uses the Manager class. The test class should prompt the user to enter the name, department, and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered. Your program should be able to handle a maximum of 3 entries. You may write the program as a console application or using dialog boxes. Please remember to include the needed comments at the top of your .java file which will identify this assignment. Please refer to Project Format and Grading Policy on the Syllabus regarding programming project expectations for the semester.

In: Computer Science

Inheritance - What is inheritance - Answer your own description in Readme.txt Based on Hamburger project,...

Inheritance - What is inheritance - Answer your own description in Readme.txt

Based on Hamburger project, you will create a package about Pizza.

In your Readme.txt, write how you make your Pizza package differently from the Hamburger package and also explain how inheritance work with your Pizza package.

package Hamburger;

/**
* Inheritance challenge – Hamburger place (Main, Hamburger, two other Burger type class)
* Hamburger class should have name, bread roll type, meat, and up to 4 additional
* additions(e.g. lettuce, tomato, carrot, etc)
* to select to be added to the burger. Each item will be charged an additional
*/
public class Hamburger {
private String name;
//meat, price, breadRollType
private String meat;
private double price;
private String breadRollType;

private String additionName1;
private double additionPrice1;

private String additionName2;
private double additionPrice2;

private String additionName3;
private double additionPrice3;

private String additionName4;
private double additionPrice4;

public Hamburger(String name, String meat, double price, String breadRollType) {
this.name = name;
this.meat = meat;
this.price = price;
this.breadRollType = breadRollType;
}

public void addHamburgerAddition1(String name, double price){
this.additionName1 = name;
this.additionPrice1 = price;
}

public void addHamburgerAddition2(String name, double price){
this.additionName2 = name;
this.additionPrice2 = price;
}

public void addHamburgerAddition3(String name, double price){
this.additionName3 = name;
this.additionPrice3 = price;
}

public void addHamburgerAddition4(String name, double price){
this.additionName4 = name;
this.additionPrice4 = price;
}


public double hamberPriceTotal(){

double hamburgerPrice = this.price;

System.out.println(this.name + " hambuger on a " + this.breadRollType + " roll with " + this.meat + "'s price is " + this.price);

if(this.additionName1 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName1 + " for an extra " + this.additionPrice1);
}

if(this.additionName2 != null){
hamburgerPrice += this.additionPrice2;
System.out.println("Added " + this.additionName2 + " for an extra " + this.additionPrice2);
}

if(this.additionName3 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName3 + " for an extra " + this.additionPrice3);
}

if(this.additionName4 != null){
hamburgerPrice += this.additionPrice4;
System.out.println("Added " + this.additionName4 + " for an extra " + this.additionPrice4);
}

return hamburgerPrice;

}

}

In: Computer Science

Inheritance - What is inheritance - Answer your own description in Readme.txt Based on Hamburger project,...

Inheritance - What is inheritance - Answer your own description in Readme.txt

Based on Hamburger project, you will create a package about Pizza.

In your Readme.txt, write how you make your Pizza package differently from the Hamburger package and also explain how inheritance work with your Pizza package.

package Hamburger;

/**
* Inheritance challenge – Hamburger place (Main, Hamburger, two other Burger type class)
* Hamburger class should have name, bread roll type, meat, and up to 4 additional
* additions(e.g. lettuce, tomato, carrot, etc)
* to select to be added to the burger. Each item will be charged an additional
*/
public class Hamburger {
private String name;
//meat, price, breadRollType
private String meat;
private double price;
private String breadRollType;

private String additionName1;
private double additionPrice1;

private String additionName2;
private double additionPrice2;

private String additionName3;
private double additionPrice3;

private String additionName4;
private double additionPrice4;

public Hamburger(String name, String meat, double price, String breadRollType) {
this.name = name;
this.meat = meat;
this.price = price;
this.breadRollType = breadRollType;
}

public void addHamburgerAddition1(String name, double price){
this.additionName1 = name;
this.additionPrice1 = price;
}

public void addHamburgerAddition2(String name, double price){
this.additionName2 = name;
this.additionPrice2 = price;
}

public void addHamburgerAddition3(String name, double price){
this.additionName3 = name;
this.additionPrice3 = price;
}

public void addHamburgerAddition4(String name, double price){
this.additionName4 = name;
this.additionPrice4 = price;
}


public double hamberPriceTotal(){

double hamburgerPrice = this.price;

System.out.println(this.name + " hambuger on a " + this.breadRollType + " roll with " + this.meat + "'s price is " + this.price);

if(this.additionName1 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName1 + " for an extra " + this.additionPrice1);
}

if(this.additionName2 != null){
hamburgerPrice += this.additionPrice2;
System.out.println("Added " + this.additionName2 + " for an extra " + this.additionPrice2);
}

if(this.additionName3 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName3 + " for an extra " + this.additionPrice3);
}

if(this.additionName4 != null){
hamburgerPrice += this.additionPrice4;
System.out.println("Added " + this.additionName4 + " for an extra " + this.additionPrice4);
}

return hamburgerPrice;

}

}

In: Computer Science