Question 1 – Inserting data to the CITY table
Using the following DML statement:
INSERT INTO CITY (id, name, countrycode, district, population) VALUES (7000, ‘Guelph’, ‘CAN’, ‘Ontario’, 131794);
Query the CITY table to ensure this row was inserted correctly.
Provide screenshot of your ‘SELECT statement’ and resultset pane here
Insert another row into the CITY table with the following values:
Id 7002
Name Montebello
Countrycode CAN
District Quebec
Population 983
Provide screenshot of your ‘INSERT statement’ and resultset pane here
Question 2 – Insert data to COUNTRY table
Insert a row into the COUNTRY table with the following values:
Code SRB
Name Serbia
Continent Europe
Region Eastern Europe
Surface Area 88361
IndepYear 2006
Population 6963764
Provide screenshot of your ‘INSERT statement’ and resultset pane here
Question 3 – Incorrect SQL statement
There are syntax errors in the following SQL statement. Correct and execute the corrected SQL statement.
INSERT INTO Country( Code, Name, Continent, Region, SurfaceArea, IndepYear, Population )
VALUES( 'MNE, 'Montenegro', 'Europe', 'Eastern Europe' 13812, 2006, 622359 );
Provide screenshot of your ‘INSERT statement’ and resultset pane here
Question 4 – Update a row in COUNTRY table
It is often necessary to query the data to determine how best to filter on the correct row (s) to update. Using the Select * from COUNTRY will display all the data and then you see all the data.
Update the column – governmentform changing the value from Serbia to Republic
But only for the country named Serbia
Note: this query should only update a single row
Provide screenshot of your ‘UPDATE statement’ and resultset pane here
Question 5 – Update a row in COUNTRY table
This ‘update’ is meant to change the ‘population’ of Canada to 37971020
Provide screenshot of your ‘UPDATE statement’ and resultset pane here
Question 6 – Deleting rows in the COUNTRYLANGUAGE table
Create the SQL statement which will delete any rows in COUNTRYLANGUAGE table where country is Canada. Hint, you should see twelve (12) rows and its is best when ‘deleting’ data, to always query the data using the filter before running the ‘delete’ statement.
Provide screenshot of your ‘UPDATE statement’ and resultset pane here
Question 7 – Deleting rows in a table
Modify the data in the COUNTRYLANGUAGE table using the script provided – CanadianLanguages2020.sql
Once you have executed this script, write a query statement that will list all rows which have English and French as languages.
Provide screenshot of your ‘SELECT statement’ and resultset pane here
Question 8 – Updating the Official Language for Canada
Modify the rows in the COUNTRYLANGUAGE table so that all rows associated to Canada has their ‘isofficial’ indicator column set to one(1).
Provide screenshot of your ‘UPDATE statement’ and resultset pane here
Question 9 – Updating more than one column using a single SQL statement
Write a single SQL statement to change the population of Algeria to 43600000 and gnp to 684689.
Provide screenshot of your ‘UPDATE statement’ and resultset pane here
In: Computer Science
Write a program IN PYTHON of the JUPYTER NOOTBOOK
Write a Python program that gets a numeric grade (on a scale of 0-100) from the user and convert it to a letter grade based on the following table.
A: 90% - 100%
B 80% - 89%
C 70% - 79%
D 60% - 69%
F <60%
The program should be written so that if the user entered either a non-numeric input or a numeric input out of the 0-100 range, it asks him/her to enter a numeric input in the correct range, instead of returning an error.
Example:
Enter your score: 78
Letter grade: C
Enter your score: seventy
Please enter a numeric score
In: Computer Science
Synchronize producer and consumer threads that use 10-item buffer for communication. Write pseudo code for both threads. Assume that you can use void Buffer::store(Item item) and Item Buffer::get() methods, but you need to explicitly ensure that you never store more than 10 items in the buffer (to prevent overflow).
In: Computer Science
Earned Value Management (EVM) is a project management technique for measuring project performance (schedule, cost mainly) and progress in an objective manner in terms of work achieved (Value): The data identified below was listed in a project’s status report. At time of status report: Planned Value of work (PV) = $70,000 Earned Value of work performed (EV) = $50,000 Actual Cost of work performed (AC) = $75,000 Original Planning: Budgeted cost At Completion (BAC) = $110,000 Original length of the project is 15 months Using the data, calculate the following: a) Expected cost At Completion (EAC). (1 mark) b) Estimate To Complete (ETC). c) The Schedule Variance (SV). d) Discuss how the project is tracking (e.g. ahead or behind schedule, under or over budget)?
In: Computer Science
Questions: Explain the following Linux commands
Show your work examples/outcome.
1. command used to locate /Home/ Directory…show the outcome
2. command used for October 2020
3. mv command and cat command
4. commands used- move to parent directory?
5. Explain why command is used ls -R? What is the meaning of -R ?
6. Explain and describe two examples of how the touch command.
7. Explain what is the outcome of the commands ls -C ?
8. Explain command echo. example
9. command used to print contents of a directory, by default it lists contents of current working directory?
10. command q ? Explain
11. Command for copy? What commands will copy hello.txt to dir2 directory?
12. du command - meaning and example
13. Explain what each of the following commands will do
14. date -d “last week”
15. date -d “yesterday”
16. cal 2018
17. cal 08 2020
cal -3
date – “1974-01-04”
18. date command? Explain and example
19. command used to make a new directory?
20. free command
Need to answer one by one.
In: Computer Science
Please create a C++ program that will ask a high school group that is made of 5 to 17 students to sell candies for a fund raiser. There are small boxes that sell for $7 and large ones that sell for $13. The cost for each box is $4 (small box) and $6 (large box). Please ask the instructor how many students ended up participating in the sales drive (must be between 5 and 17). The instructor must input each student’s First name that sold items and enter the number of each box sold each (small or large). Calculate the total profit for each student and at the end of the program, print how many students participated and the total boxes sold for each (small and large) and finally generate how much profit the group made. (15 points)
In: Computer Science
In: Computer Science
Fat Percentage Calculator
Create a C++ program that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat.
One gram of fat has 9 calories, so: Calories from fat = fat grams * 9
The percentage of calories from fat can be calculated as:
Percentage of calories from fat = Calories from fat / total calories
Input validation: Make sure the number of calories are not less than 0. Also, the number of calories from fat cannot be greater than the total number of calories. If that happens, display an error message indicating that either the calories or fat grams were incorrectly entered.
Use the following test data to determine if the application is calculating properly:
Calories and Fat Percentage Fat
200 calories, 8 fat grams Percentage of calories from fat: 36% 150 calories 2 fat grams Percentage of calories from fat: 12% (a low-fat food)
500 lories, 30 fat grams Percentage of calories from fat: 54%
In: Computer Science
string getStyle() ;
int getNumOfBedRooms() ;
int getNumOfBathRooms();
int getNumOfCarsGarage();
int getYearBuilt();
int getFinishedSquareFootage() ;
double getPrice(double p) ;
double getTax(double t) ;
void print() ;
houseType();
houseType(string s, int numOfBeds, int numOfBaths, int
numOfCars,
int yBuilt, int squareFootage, double p, double t);
private:
string style;
int numOfBedrooms;
int numOfBathrooms;
int numOfCarsGarage;
int yearBuilt;
int finishedSquareFootage;
double price;
double tax;
};
Questions
a.Write the definition of the member function set so that private
members are set accordingy to the parameters.
b. Write the definition of the member function print that prints
the values of the data members.
c. Write the definition of the constructor of the class houseType
so that the private member variables are initialized according to
the parameters.
d. Write a Java statement that prints the value of the object
newHouse.
e. Write a Java statement that declares an object house of type
newHouse and initializes the member variables of house to
"Ranch",3,2,2,2005,1300,185000 and 3600.0 respectively.
f. Which function members are accessors and which are mutators
?
Solved in Java please
In: Computer Science
Software Sales A software company sells three packages, Package A, Package B, and Package C, which retail for $99, $199, and $299, respectively. Quantity discounts are given according to the following table: Quantity Discount 10 through 19 20% ,20 through 49 30% ,50 through 99 40% ,100 or more 50% . Create a C++ program that allows the user to enter the number of units sold for each software package. The application should calculate and display the order amounts and the grand total. Input validation: Make sure the number of units for each package is not negative.
Use the following test data to determine if the application is calculating properly: Units Sold Amount of Order Package A: 15 units Package A: $1,188.00
Package B: 75 units Package B: $8,955.00
Package C: 120 units Package C: $17,940.00
Grand Total: $28,083.00
In: Computer Science
Code using JAVA:
must include a "Main Method" to run on "intelliJ".
Hint: Use recursion
"
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public boolean isSymmetric(TreeNode root) {
}
}
"
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1 / \ 2 2 / \ / \ 3 4 4 3
But the following [1,2,2,null,3,null,3] is not:
1 / \ 2 2 \ \ 3 3
Follow up: Solve it both recursively and iteratively.
In: Computer Science
Create a C# Application. Create a class object called “Employee” which includes the following private variables:
firstN
lastN
idNum
wage: holds how much the person makes per hour
weekHrsWkd: holds how many total hours the person worked each
week
regHrsAmt: initialize to a fixed amount of 40 using
constructor.
regPay
otPay
After going over the regular hours, the employee gets 1.5x the
wage for each additional hour worked. Methods:
constructor
properties
CalcPay(): Calculate the regular pay and overtime pay.
Create an “EmployeeDemo” class. In the main function, the program should ask the user the number of employee in the company and create a 2-dimensional dynamic array (number of employee by 4 weeks). Then, the program should ask user to enter each employee’s information and the amount of hours they worked weekly.
The program shows a menu with employee name for user to choose
which employee to display the following information:
How much the person totally made
How much of paycheck is regular pay
How much of paycheck is overtime pay
In: Computer Science
In PYTHON OF JUPIDER NOTEBOOK
Write a program that prompts the user to enter his/her
nationality (French/french, Italian/italian, or Spanish/spanish).
Then ask his/her name using a prompt message in his/her own
language (use Google Translate if you need). After getting the
name, again greet him/her using a greeting message in his/her own
language.
If the user is not from any of the above nationalities just use
English to prompt for name and to greet the user.
Example 1:
Nationality? french
quel est votre nom? Patrick
Bonjour Patrick , mon nom est Python!
Example 2:
Nationality? Canadian
What is your name? Alex
Hello Alex , my name is Python!
In: Computer Science
Rewrite your program for finding Pascal's Triangle to use iteration (loops) instead of recursion. Include in both algorithms code to keep track of the total time used to run the algorithms in milliseconds. Run these algorithms for n = 10, n = 20, and n = 30. Print out both the original output and the time to run for both algorithms. Please make sure you comment your code thoroughly. The code should be nicely formatted and should use proper variables.
In: Computer Science
this is in excel VB8
Program 3: Long-Distance Calls A long-distance provider charges the following rates for telephone calls: Rate Category Rate per Minute Daytime (6:00 A.M. through 5:59 P.M.) $0.07 Evening (6:00 P.M. through 11:59 P.M.) $0.12 Off-Peak (12:00 A.M. through 5:59 A.M.) $0.05 Create an application that allows the user to select a rate category and enter the number of minutes of the call, then displays the charges. Use the following test data to determine if the application is calculating properly: Rate Category and Minutes Charge Daytime, 20 minutes $ 1.40 Evening, 20 minutes $ 2.40 Off-peak, 20 minutes $ 1.00 1) Time Calculator Create a application that lets the user enter a number of seconds and produces output according to the following criteria:• There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. • There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours in that many seconds. • There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86,400, the program should display the number of days in that many seconds.
this is in excel VB8
In: Computer Science