1. Discuss the different measures of central tendency that have been used during the pandemic with Examples.
2. What is the Distinguish between classical, empirical, and subjective probability and give examples of each.
In: Statistics and Probability
State the differences between:
In: Computer Science
Why doesn't capital flow from rich to poor countries? Please write an essay on this issue which consists of two paragraphs. Please mention the theoretical and empirical arguments. Thoroughly explain this.
In: Economics
An unknown compound contains only C, H, and O. Combustion of 3.90 g of this compound produced 9.18 g of CO2 and 2.51 g of H2O.
What is the empirical formula of the unknown compound?
In: Chemistry
Tables:
Create table Item( &nbs...
Bookmark
Tables:
Create table Item(
ItemId char(5) constraint itmid_unique primary key,
Decription varchar2(30),
Unitcost number(7,2));
Create table Customer(
custID char(5) constraint cid.unique primary key,
custName varchar2(20),
address varchar2(50));
Create table Orderdata(
orderID char(5) constraint oid_uniq primary key,
orderdate date,
shipdate date,
ItemId char(5) references Item.ItemId,
No_of_items number(4),
Unitcost number(7,2),
Order_total number(7,2),
custID char(5) references customer.custID);
Insert Into Item values(‘A123’,’Pencil’,2.5);
Insert Into Item values(‘B123’,’Pen’,15);
Insert Into Customer(‘C123’,’ABC Gen stores’,’Sanfransico’);
Insert Into Customer(‘C132’,’XYZ stores’,’California’);
Insert into Orderdata(‘o123’,’12-aug-2016’,’12-aug-2016’,’A123’,5,2.5,12.5,’c123’);
Insert into Orderdata(‘o124’,’14-aug-2016’,’14-aug-2016’,’B123’,5,15,75,’c132’);
_____________________________________________________________
Enhance your Module 5 CT database table structures, via your selected RDBMS, as you wish.
, using SQL and an SQL script file, create and execute advanced queries of your choice that demonstrate each of the following:
The use of a GROUP BY clause, with a HAVING clause, and one or more group functions
The use of UNION operator
The use of a subquery
The use of an outer join
Then create and execute at least one SQL UPDATE and at least one SQL DELETE query.
Finally, create and use an SQL view and in a SELECT query.
Submit the following outputs of your SQL script file processing, in this order and appropriately labeled, in a single Word file:
The SQL and results of your INSERT statements to further populate your tables
The SQL and results of your 4 advanced SELECT queries
The SQL and results of your UPDATE and DELETE queries
The SQL and results of your view creation and its use in a SELECT query
You must show all of your SQL as it executed in Management Studio or other development environments. This includes the results returned by your selected RDBMS.
(((((((((((Note)))))))))))))))): you must populate any other tables and show the execution of your SQL statements as required.
Use a SELECT statement using the UNION operator.
create a view and use it in a SELECT query...
In: Computer Science
|
Amy Ltd: comparison to previous year |
|||
|
2017 |
2018 |
2019 |
|
|
Accounts receivable |
1.20% |
8.2% |
7.4% |
|
Inventory |
8.4% |
1.7% |
4.9% |
|
Sales |
-3.0% |
1.2% |
5.4% |
|
Non-current assets |
2.3% |
4.8% |
7.6% |
|
Borrowings |
3% |
9.8% |
19.8% |
Required: provide a brief report on the results of the analysis? Comments should include any concerns you may have
In: Accounting
1).Modify the project so that records are inserted into the random access file in ascending order using an insertion sort methodology with the Social Security Number acting as the key value. This requires defining the method compareTo() in the Personal and Student classes to be used in a modified method add() in Database. The method finds a proper position for a record d, moves all the records in the file to make room for d, and writes d into the file.
2. With the new organization of the data files. find() and modify() must also be modified. Both methods should now stop their sequential search when they encounter a record greater than the record looked for, or they reach the end of the file.
I am having trouble initializing the compareTo()
Personal.java
import java.io.*;
import java.util.Arrays;
import Student.Student;
public class Personal extends IOmethods implements DbObject
{
protected final int nameLen = 10, cityLen = 10;
protected String SSN, name, city;
protected int year;
protected long salary;
protected final int size = 9*2 + nameLen*2 + cityLen*2 + 4 +
8;
Personal() {
}
Personal(String ssn, String n, String c, int y, long s) {
SSN = ssn; name = n; city = c; year = y; salary = s;
}
public int size() {
return size;
}
public void writeToFile(RandomAccessFile out) throws IOException
{
writeString(SSN,out);
writeString(name,out);
writeString(city,out);
out.writeInt(year);
out.writeLong(salary);
}
public void writeLegibly() {
System.out.print("SSN = " + SSN + ", name = " + name.trim()
+ ", city = " + city.trim() + ", year = " + year
+ ", salary = " + salary);
}
public void readFromFile(RandomAccessFile in) throws IOException
{
SSN = readString(9,in);
name = readString(nameLen,in);
city = readString(cityLen,in);
year = in.readInt();
salary = in.readLong();
}
public void readKey() throws IOException {
System.out.print("Enter SSN: ");
SSN = readLine();
}
public void readFromConsole() throws IOException {
System.out.print("Enter SSN: ");
SSN = readLine();
System.out.print("Name: ");
name = readLine();
for (int i = name.length(); i < nameLen; i++)
name += ' ';
System.out.print("City: ");
city = readLine();
for (int i = city.length(); i < cityLen; i++)
city += ' ';
System.out.print("Birthyear: ");
year = Integer.valueOf(readLine().trim()).intValue();
System.out.print("Salary: ");
salary = Long.valueOf(readLine().trim()).longValue();
}
public void copy(DbObject[] d) {
d[0] = new Personal(SSN,name,city,year,salary);
}
public int compareTo(String p) {
}
}
Student.java
import java.io.*;
public class Student extends Personal {
public int size() {
return super.size() + majorLen*2;
}
protected String major;
protected final int majorLen = 10;
Student() {
super();
}
Student(String ssn, String n, String c, int y, long s, String m)
{
super(ssn,n,c,y,s);
major = m;
}
public void writeToFile(RandomAccessFile out) throws IOException
{
super.writeToFile(out);
writeString(major,out);
}
public void readFromFile(RandomAccessFile in) throws IOException
{
super.readFromFile(in);
major = readString(majorLen,in);
}
public void readFromConsole() throws IOException {
super.readFromConsole();
System.out.print("Enter major: ");
major = readLine();
for (int i = major.length(); i < nameLen; i++)
major += ' ';
}
public void writeLegibly() {
super.writeLegibly();
System.out.print(", major = " + major.trim());
}
public void copy(DbObject[] d) {
d[0] = new Student(SSN,name,city,year,salary,major);
}
public int compareTo() {
}
}
DbObject.java
import java.io.*;
public interface DbObject {
public void writeToFile(RandomAccessFile out) throws
IOException;
public void readFromFile(RandomAccessFile in) throws
IOException;
public void readFromConsole() throws IOException;
public void writeLegibly() throws IOException;
public void readKey() throws IOException;
public void copy(DbObject[] db);
public int size();
}
IOmethods,java
import java.io.*;
public class IOmethods {
public void writeString(String s, RandomAccessFile out) throws
IOException {
for (int i = 0; i < s.length(); i++)
out.writeChar(s.charAt(i));
}
public String readString(int len, RandomAccessFile in) throws
IOException {
String s = "";
for (int i = 0; i < len; i++)
s += in.readChar();
return s;
}
public String readLine() throws IOException {
int ch;
String s = "";
while (true) {
ch = System.in.read();
if (ch == -1 || (char)ch == '\n') // end of file or end of
line;
break;
else if ((char)ch != '\r') // ignore carriage return;
s = s + (char)ch;
}
return s;
}
}
Database.java
import java.io.*;
public class Database {
private RandomAccessFile database;
private String fName = new String();;
private IOmethods io = new IOmethods();
Database() throws IOException {
System.out.print("File name: ");
fName = io.readLine();
}
private void add(DbObject d) throws IOException {
database = new RandomAccessFile(fName,"rw");
database.seek(database.length());
d.writeToFile(database);
database.close();
}
private void modify(DbObject d) throws IOException {
DbObject[] tmp = new DbObject[1];
d.copy(tmp);
database = new RandomAccessFile(fName,"rw");
while (database.getFilePointer() < database.length()) {
tmp[0].readFromFile(database);
if (tmp[0].equals(d)) {
tmp[0].readFromConsole();
database.seek(database.getFilePointer()-d.size());
tmp[0].writeToFile(database);
database.close();
return;
}
}
database.close();
System.out.println("The record to be modified is not in the
database");
}
private boolean find(DbObject d) throws IOException {
DbObject[] tmp = new DbObject[1];
d.copy(tmp);
database = new RandomAccessFile(fName,"r");
while (database.getFilePointer() < database.length()) {
tmp[0].readFromFile(database);
if (tmp[0].equals(d)) {
database.close();
return true;
}
}
database.close();
return false;
}
private void printDb(DbObject d) throws IOException {
database = new RandomAccessFile(fName,"r");
while (database.getFilePointer() < database.length()) {
d.readFromFile(database);
d.writeLegibly();
System.out.println();
}
database.close();
}
public void run(DbObject rec) throws IOException {
String option;
System.out.println("1. Add 2. Find 3. Modify a record; 4.
Exit");
System.out.print("Enter an option: ");
option = io.readLine();
while (true) {
if (option.charAt(0) == '1') {
rec.readFromConsole();
add(rec);
}
else if (option.charAt(0) == '2') {
rec.readKey();
System.out.print("The record is ");
if (find(rec) == false)
System.out.print("not ");
System.out.println("in the database");
}
else if (option.charAt(0) == '3') {
rec.readKey();
modify(rec);
}
else if (option.charAt(0) != '4')
System.out.println("Wrong option");
else return;
printDb(rec);
System.out.print("Enter an option: ");
option = io.readLine();
}
}
}
UseDatabase.java
import java.io.IOException;
public class UseDatabase {
static public void main(String a[]) throws IOException {
// (new Database()).run(new Personal());
(new Database()).run(new Student());
}
}
In: Computer Science
analyze the unemployment rate and inflation from 2000 - 2010 in the US.
discuss the interest rate fluctuations from 2000 - 2010 in the US
In: Economics
Review the YouTube video "An Update on Adult Immunizations," featured in the Instructional Materials, and list two common misconceptions about adult vaccinations. How can you help address these misconceptions? Also list two illnesses that these immunizations aim to prevent. Do you feel the immunizations are accomplishing this goal? Why or why not? If not, what is your solution?
In: Nursing
Update the code from the questions if necessary.
#include
#include
/*
Program sorts an array of integers using a selection sort.
The general algorithm repeatedly finds the smallest number
in the array and places it at the front of the list.
*/
using namespace std;
int find_small_index (int start_index, int numbers []);
void swap_values (int index1, int index2, int numbers []);
int main(int argc, char *argv[])
{
// array of numbers
int numbers [10] = {7, 9, 21, 16, 65, 8, 32, 1, 17, 41};
int start_index; // current starting spot for search
int small_index; // index of the smallest number in the array
int index; // index used for print the array values
start_index = 0;
// continue finding the smallest value and placing it
// at the front of the list
while (start_index < 9)
{
small_index = find_small_index (start_index, numbers);
swap_values (small_index, start_index, numbers);
start_index++;
}
cout << "\n\nThe sorted array is:\n";
for (index = 0; index < 10; index++)
cout << numbers [index] << " ";
cout << "\n\n";
return 0;
}
int find_small_index (int start_index, int numbers [])
{
int small_index, // smallest index to be returned
index; // current index being viewed
small_index = start_index;
for (index = start_index + 1; index < 10; index++)
if (numbers [index] < numbers [small_index])
small_index = index;
return small_index;
}
void swap_values (int index1, int index2, int numbers [])
{
int swapper;
swapper = numbers [index1];
numbers [index1] = numbers [index2];
numbers [index2] = swapper;
}
1. What value would find_small_index return for the following array?
|
34 |
17 |
26 |
44 |
12 |
81 |
72 |
20 |
62 |
44 |
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
2. Assume that the array in question 1 is being used, will the value of the Boolean expression in the if statement in find_small_index be true or false when index is equal to 3 in the for loop? Explain your answer.
3.What is the point of the assignment small_index = start_index; at the beginning of find_small_index? How does this help the function to accomplish its goal?
4. start_index is increased by 1 each time through the loop in main. When find_small_index is called with start_index equal to 5, what must be true about the array values in indexes 0 through 4?
5. In the while loop in main, start_index only goes up to 8 (start_index < 9). Explain why the loop does not need to run when start_index equals 9 (the last index in the array).
6. In swap_values, swapper is declared as an int type. Why?
In: Computer Science