Create a python program that:
In: Computer Science
You have information about recent sales that you want to use for testing the database. 1. Create the tables for the data provided. The tables should include the primary and foreign keys. Provide the SQL statements. 2. Insert the data into the tables. Provide the SQL statements. 3. Show the contents of each table. Provide the SQL statements.
Customer Table Customer ID, Last Name, First Name, Street Address, City, State, Zip Code, Current Balance, Credit Limit, Sales Rep. ID Sales Representatives Table Sales Rep ID, Last Name, First Name, Street Address, City, State, Zip, Region, Region Description, Total Commission, Commission Rate Orders Table Order ID, Order Date, Customer, Shipping Date, Order Lines Order ID, Part ID, Number Ordered, Quoted Price Part Table Part ID, Part Description, Units on Hand, Class, Warehouse Number, Unit Price
Please show all work
In: Computer Science
JAVASCRIPT: -
Please create an object (grade) with 10 names and 10 grades.
- Create a method (inputGrade) that can put a name and a grade to
the grade object.
- Create another method (showAlltheGrades) to show all the grade in
that object.
- Create the third method (MaxGrade) that can display the maximum
grade and the student name.
- Using “prompt” and inputGrade method input 10 student names and
their grades.
- Display all the grades and names by using showAlltheGrades
method.
NOTE: Make sure to use the push() method when adding
elements to the arrays. Please post the code and a screenshot of
the output. Thanks!
[Reference JavaScript code]
<html>
<body>
<script>
// Declare a class
class Student {
// initialize an object
constructor(grade, name) {
this.grade=grade;
this.name=name; }
//Declare a method
detail() {
document.writeln(this.grade + " " +this.name)
}//detail
}//class
var student1=new Student(1234, "John Brown");
var student2=new Student(2222, "Mary Smith");
student1.detail();//call a method
student2.detail();
</script>
</body>
</html>
In: Computer Science
Create a website for an online movie
rental store, using HTML (and any other
client technologies) and PHP. The website should
include:
- A front/home page containing a list of movies available for rent (list at least 10 movies).
o Each movie should have a listed rental price.
o Additional information provided:
§ name of actors in the movie (list at least 2)
- The home page should link to a form for renting a movie
o Selecting and submitting a movie for rent will lead to a page displaying
§ the name of the movie rented,
§ the amount charged (calculated with 5% tax),
§ the date and time rented, and § the date and time the movie is due for return (in 5 days).
- A form linked through the home page for selecting a movie and submitting a user review.
o Input fields should include
§ The name of the movie
§ Username
§ Rating in 5 stars
§ User review
o Output after submitting a review should show the name of the movie and all submitted information.
In: Computer Science
In: Computer Science
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 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) 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 – 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 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