All the questions are to run on the Application DATABASE Student(SID,SName,GPA,sizeHS); college(CName,State, Enroolment); Apply(SID,CName,Major,Decision) ;

PLEASE MAKE SURE THERE ARE NO DUPLICATES IN YOUR RESULTS

Q1.1: Get the names of all the students whose GPA>=3.8;

Q1.2:Get the names of all the students who applied to some college;

Q1.3: Get the names all the students who did not applied to any college;

Q1.4: Get the names and enrollment of all the colleges who received applications for a major involving bio;

Q1.5: Get all pairs of students who have the same GPA;

Q1.6: Get all the students who applied to both CS and EE majors;

Q7: Get all the students who applied to CS and not to EE;

Q1.8: Use subquery to answer Q1.6 & Q1.7;

Q1.9 :Get all colleges such that some other college is in the same state;

Q1.10: Get all students.with highest GPA--use the keyword EXISTS or NOT EXISTS to answer the query; hint; use a subquery

Q1.11: Now pair colleges with the name of their applicants.

Answers

Answer 1

Answer:

Check the explanation

Explanation:

Q1: SQL to list names of all the students whose GPA is above specific number:

select SName

from Student

where GPA >= 3.8;

Using the Student table we are able to get the details where the GPa is greater than the required value.

Q2: SQL to get list of names of all the students who applied to some college:

select SName from Student where SID in (

select distinct SID from Apply

);

Selecting the name of the students who are present in the Apply table.

Q3: SQL to get list of names all the students who did not apply to any college:

select SName from Student where SID not in (

select distinct SID from Apply

);

Selecting the name of the students who are not present in the Apply table.

Q4: SQL to get list of names and enrollment of all the colleges who received applications for a major involving bio:

select CName, Enrollment from College where CName in (

select CName from Apply where Major = 'Bio' and SID in (

select SID from Student

)

);


Related Questions

Implement the function maxLoc(), which returns an iterator at the largest element in a list. template typename list::iterator maxLoc(list& aList); Write a program that tests maxLoc(), using the following declarations: int intArr[] = {23, 49, -3, 29, 17, 200, 38, 93, 40}; int intSize = sizeof(intArr)/sizeof(int); list intList(intArr,intArr+intSize); char chrArr[] = "Hello World!"; int chrSize = sizeof(chrArr); list chrList(chrArr,chrArr+chrSize); The program should repeatedly call maxLoc(), output the largest value, and then delete the value, until the list is empty.

Answers

Answer:

See explaination

Explanation:

#include <iostream>

#include <iterator>

#include <list>

using namespace std;

list <int> :: iterator maxLoc(list<int>& alist){

list<int> :: iterator max;

list<int> :: iterator it;

int maxs = -199999999;

for (it = alist.begin(); it != alist.end();it++){

int c = *it;

if(maxs < c){

max = it;

maxs = *it;

}

}

alist.erase(max);

return max;

}

list <char> :: iterator maxLoc(list<char>& alist){

list<char> :: iterator max;

list<char> :: iterator it;

int maxs = -199999999;

for (it = alist.begin(); it != alist.end();it++){

char c = *it;

if(maxs < c){

max = it;

maxs = *it;

}

}

alist.erase(max);

return max;

}

int main() {

int intArr[] = {23, 49, -3, 29, 17, 200, 38, 93, 40};

int intSize = sizeof(intArr) / sizeof(int);

list <int> intlist(intArr, intArr + intSize);

list<int> :: iterator it;

for(int i = 0;i<intSize;i++){

list<int> :: iterator m = maxLoc(intlist);

cout << *m << endl;

}

char chrArr[] = "Hello World!";

int chrSize = sizeof(chrArr);

list<char> chrlist(chrArr, chrArr + chrSize);

for(int j = 0;j<chrSize;j++){

list<char> :: iterator m = maxLoc(chrlist);

cout << *m << endl;

}

}

SOLVE IN C:
"Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore. Upon a mismatch, exit the loop using a break statement. Assume simonPattern and userPattern are always the same length. Ex: The following patterns yield a userScore of 4:simonPattern: RRGBRYYBGYuserPattern: RRGBBRYBGYplease use comments to explain each step!! #include #include int main(void) { char simonPattern[50]; char userPattern[50]; int userScore; int i; userScore = 0; scanf("%s", simonPattern); scanf("%s", userPattern);**YOUR ANSWER GOES HERE** printf("userScore: %d\n", userScore); return 0;}

Answers

Answer:

#include <stdio.h>

#include <string.h>

int main(void) {

  char simonPattern[50];

  char userPattern[50];

  int userScore;

  int i;

  userScore = 0;

  scanf("%s", simonPattern);

  scanf("%s", userPattern);

  for(i = 0;simonPattern[i]!='\0';i++){

         if(simonPattern[i]!=userPattern[i]){

            userScore=i;

            break;

     }

  }

  printf("userScore: %d\n", userScore);

  return 0;

}

Explanation:

Use a for loop that runs until it does not reach the end of simonPattern.Check whether the current index of simonPattern and userPattern are not equal and then assign the value of i variable to the userScore variable and break out of the loop.Finally display the user score.

Give a recursive algorithm to compute the sum of the cubes of the first n positive integers. The input to the algorithm is a positive integer n. The output is ∑j=1nj3. The algorithm should be recursive, it should not compute the sum using a closed form expression or a loop.

Answers

Answer:

def sum_cubes(n):

   if n == 1:

       return 1

   else:

       return n * n * n + sum_cubes(n-1)

print(sum_cubes(3))

Explanation:

Create a function called sum_cubes that takes one parameter, n

If n is equal to 1, return 1. Otherwise, calculate the cube of n, and add it to the sum_cubes function with parameter n-1

If we want to calculate the cubes of the first 3 numbers:

sum_cubes(3) = 3*3*3 + sum_cubes(2)

sum_cubes(2) = 2*2*2 + sum_cubes(1)

sum_cubes(1) = 1

If you substitute the values from the bottom, you get 27+8+1 = 36

Create a class that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant is skilled in each of the following areas: word processing, spreadsheets, databases, and graphics. Include a constructor that accepts values for each of the fields. Also include a get method for each field. Create an application that instantiates several job applicant objects and pass each in turn to a Boolean method that determines whether each applicant is qualified for an interview. Then, in the main() method, display an appropriate method for each applicant. A qualified applicant has at least three of the four skills. Save the files as JobApplicant.java and TestJobApplicants.java.

Answers

Answer:

Explanation:

I don't know about the answer in java.

This is what I did in C#. Find attached the answer

public class JobApplication

   {

       private string name;

       public string Name

       {

           get { return name; }

           set { name = value; }

       }

       private string phoneNumber;

       public string PhoneNumber

       {

           get { return phoneNumber; }

           set { phoneNumber = value; }

       }

       private bool isSKilledInWordProcessing;

       public bool IsSkilledInWordProcessing

       {

           get { return isSKilledInWordProcessing; }

           set { isSKilledInWordProcessing = value; }

       }

       private bool isSkilledInSpreadsheets;

       public bool IsSkilledInSpreadsheets

       {

           get { return isSkilledInSpreadsheets; }

           set { isSkilledInSpreadsheets = value; }

       }

       private bool isSkilledInDatabases;

       public bool IsSkilledInDatabases

       {

           get { return isSkilledInDatabases; }

           set { isSkilledInDatabases = value; }

       }

       private bool isSkilledInGraphics;

       public bool IsSkilledInGraphics

       {

           get { return isSkilledInGraphics; }

           set { isSkilledInGraphics = value; }

       }

       public JobApplication(string name, string phoneNumber, bool isSKilledInWordProcessing,

           bool isSkilledInSpreadsheets, bool isSkilledInDatabases, bool IsSkilledInGraphics)

       {

           Name = name;

           PhoneNumber = phoneNumber;

           IsSkilledInDatabases = isSkilledInDatabases;

           IsSkilledInGraphics = isSkilledInGraphics;

           IsSkilledInWordProcessing = IsSkilledInWordProcessing;

           IsSkilledInSpreadsheets = isSkilledInSpreadsheets;

       }

   }

   class Program

   {

       static void Main(string[] args)

       {

           JobApplication jobApplication1 = new JobApplication("Emmanuel Man", "+39399399", false, true, true, true);

           CheckIfQualified(jobApplication1);

       }

       static void CheckIfQualified(JobApplication jobApplication)

       {

           if(jobApplication.IsSkilledInSpreadsheets && jobApplication.IsSkilledInGraphics  

               && jobApplication.IsSkilledInWordProcessing && jobApplication.IsSkilledInDatabases)

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is qualified for the job");

           } else if (jobApplication.IsSkilledInSpreadsheets && jobApplication.IsSkilledInGraphics

               && jobApplication.IsSkilledInWordProcessing)

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is qualified for the job");

           }

           else if (jobApplication.IsSkilledInSpreadsheets && jobApplication.IsSkilledInGraphics

               && jobApplication.IsSkilledInDatabases)

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is qualified for the job");

           } else if (jobApplication.IsSkilledInWordProcessing && jobApplication.IsSkilledInGraphics

               && jobApplication.IsSkilledInDatabases)

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is qualified for the job");

           }else if (jobApplication.IsSkilledInWordProcessing && jobApplication.IsSkilledInSpreadsheets

               && jobApplication.IsSkilledInDatabases)

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is qualified for the job");

           }

           else

           {

               Console.WriteLine("The applicant, " + jobApplication.Name + " is not qualified for the job");

           }

       }

   }

Answer:

import java.util.Scanner;

public class TestJobApplicant{

public static void main(String[] args)

{

   JobApplicant applicant1 = new JobApplicant("Ted","555-1234", true, false, false, false);

   JobApplicant applicant2 = new JobApplicant("Lily", "655-1235", true, false, true, false);

   JobApplicant applicant3 = new JobApplicant("Marshall", "755-1236", false, false, false, false);

   JobApplicant applicant4 = new JobApplicant("Barney", "855-1237", true, true, true, false);

   JobApplicant applicant5 = new JobApplicant("Robin", "955-1238", true, true, true, true);

 

   String qualifiedMessage = "is qualified for an interview. ";

   String notQualifiedMessage = "is not qualified for an interview at this time. ";

   

   

   if (isQualified(applicant5))

       display(applicant5, qualifiedMessage);

   else

       display(applicant5, notQualifiedMessage);

}

   public static boolean isQualified(JobApplicant applicant) {

       int count = 0;

       boolean isQualified;

       final int MIN_SKILLS = 3;

     

       if(applicant.getWord())

           count += 1;

       if(applicant.getSpreadsheet())

           count += 1;

       if(applicant.getDatabase())

           count += 1;

       if(applicant.getGraphics())

           count += 1;

       if(count >= MIN_SKILLS)

           isQualified = true;

       else

           isQualified = false;

       return isQualified;

   }

   public static void display(JobApplicant applicant, String message) {

       System.out.println(applicant.getName() + " " + message +" Phone: " + applicant.getPhone());

   }

}

class JobApplicant {

   private String name, phone;

   private boolean word, spreadsheet, database, graphics;

   public JobApplicant(String name, String phone, boolean word, boolean spreadsheet, boolean database, boolean graphics){

       this.name = name;

       this.phone = phone;

       this.word = word;

       this.spreadsheet = spreadsheet;

       this.database = database;

       this.graphics = graphics;

   }

   public String getName() {return name;}

   public String getPhone() {return phone;}

   public boolean getWord() {return word;}

   public boolean getSpreadsheet() {return spreadsheet;}

   public boolean getDatabase() {return database;}

   public boolean getGraphics() {return graphics;}

}

Explanation:

Inside the JobApplicant class:

- Declare the variables

- Initialize the constructor

- Create the get methods for each variable

Inside the TestJobApplicant class:

- Create an isQualified method that checks if given applicant is qualified for the job.

- Create a display method that prints the name, message and phone number for the applicant

Inside the main:

- Initialize the applicant objects and messages

- Call the isQualified method with an applicant to see the result

Differences between the Services in career paths leading up to a joint assignment may surprise new staff Service members in joint assignments. This demonstrates which key element to remember when working with other services?

Answers

Answer:

Prior Experience Working with Senior Officers versus Little or None.

Explanation:

Differences and disparities between the Services in career paths leading up to a joint assignment may surprise new staff officers in joint assignments.

For example, Army and Air Force officers will likely come to a joint assignment with prior junior officer experience as an administrative “exec” to a senior officer at the O-5 and above level.

In contrast, Navy, Marine Corps and Coast Guard officers will have had no such experience unless selected for one of the highly competitive Flag Aide or Aide-de-Camp billets to an O-7 or above who rates such an aide.

Having an experience working with senior officers and when a person has little or none shows the key element to remember when working with other services.

What is the aim of joint operations?

The act of working together in a joint project helps to provide some amount of guidance for the use of authority.

Note that having a previous experience in working with senior officers and when a person has little or none can be obviously shown when working with other services.

Learn more about Career from

https://brainly.com/question/9719007

#Java
What is the solution? ​

Answers

Answer:

I have answered the first part in another question of yours, but the second part is in the provided screenshot!

Explanation:

Steps to solve this problem:

Go through all the numbers from 1 -> n1, every time you go through each of these numbers, go through all the numbers from 1 -> n2. Multiply these numbers and add them to an output string. Print each line of output.

1. Write code that prints the square root of the value in the variable num rounded to 4 decimal places. Assume that num already has a value and that the math module has been imported.

Answers

Answer:

System.out.printf("The square root is %.4f\n",sqrt);

Explanation:

In Java programming language using the print format method of System.out One can specify the the number of decimal places. In this case to 4 decimal places.

See a complete code snippet below

public class num1 {

   public static void main(String[] args) {

       double num =5;

       double sqrt = Math.sqrt(5);

       System.out.printf("The square root is $%.4f\n",sqrt);

   }

}

Please construct a program that reads the content from the file numbers.txt. There are two lines in the file, each is an integer number. Print out the two numbers and their sum in an equation as below: Content in numbers.txt: 45 28 Output of the program: 45 28

Answers

Answer:

file = open("numbers.txt")

numbers = []

for line in file:

   numbers.append(int(line))

print("The numbers in the file: " + str(numbers[0]) + " " + str(numbers[1]))

print("The sum of the numbers: " + str(numbers[0] + numbers[1]))

Explanation:

The code is in Python.

Open the file named numbers.txt

Create an empty list, numbers, to hold the numbers in the file

Create a for loop that iterates through file and adds the number inside the file to the list

Print numbers

Calculate and print the sum of the numbers

Final answer:

To read two integers from a file and print their sum, use a Python script to open the file, convert the strings to integers, calculate the sum, and print the results with the equation format.

Explanation:

To construct a program that reads the content from the file numbers.txt and prints out the two numbers along with their sum, you would need to use a programming language. Below is an example of how you might write such a program in Python:

with open('numbers.txt', 'r') as file:
   numbers = file.read().splitlines()

num1 = int(numbers[0])
num2 = int(numbers[1])
sum_of_numbers = num1 + num2

print(f"{num1} + {num2} = {sum_of_numbers}")

This program opens the file numbers.txt, reads its content line by line, converts the lines to integers, and then calculates their sum. Finally, it prints out the numbers and the sum in the format specified. It is assumed that numbers.txt contains one number per line and that these can be converted directly to integers.

Purchasing services from a cloud provider has many advantages, as was discussed in Section 7.5. However, the cloud can also create problems with regard to your business or research environment. For each of the following areas, discuss problems that could occur when you purchase cloud services to handle your company's data storage backup.

a. Internet outages

b. Data security

c. Data inflexibility

d. Customer support

Answers

Answer:

See explaination

Explanation:

Kindly check the attachment for the details

Write a statement that declares a variable of the enumerated data type below. enum Flower { ROSE, DAISY, PETUNIA } The variable should be named flora. Initialize the variable with the ROSE constant.

Answers

Answer:

enum Flower { ROSE, DAISY, PETUNIA }

Flower flora = Flower.ROSE

Explanation:

Flower is of Enumeration data type and it contains the constants ROSE, DAISY and PENTUA.

To write a statement that declares a variable of that type you use

Var_of_enum_type Var_name

And to initialize it with a constant of the enumeration data type you use the dot (.) operator.

Var_of_enum_type.CONSTANT

Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)
If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call (countdown or countup) for input of zero.
Provide the following.

The code of your program.
Output for the following input: a positive number, a negative number, and zero.
An explanation of your choice for what to call for input of zero.

Answers

Answer:

Complete Python code along with step by step explanation is provided below.

Python Code:

# create a recursive countdown function that will count in decreasing order

def countdown(n):

   if n >= 0:

       print(n)

       countdown(n-1)

# create a recursive countup function that will count in increasing order.

def countup(n):

   if n <= 0:

       print(n)

       countup(n+1)  

# driver code

def main():

# get input from the user

   n = int(input("Please enter any number: "))

# call the countdown function if input n is zero or greater than zero.

# whether you choose countdown or countup for input n the outcome will be same in both cases

   if n >= 0:

       countdown(n)

# call the countup function for the remaining case that is n is less than zero.

   else:

       countup(n)

# call the main function

main()

Output:

Test 1:

Please enter any number: 5

5

4

3

2

1

0

Test 2:

Please enter any number: -6

-6

-5

-4

-3

-2

-1

0

Test 3:

Please enter any number: 0

0

Following  are the python program to the given question:

Program Explanation:

Defining two methods "countdown, countup" that takes one parameter.In both methods, it uses an if block that checks the parameter value and prints its value with the message.In the next step, the "n" variable is defined that inputs the value and uses the if block that checks the value and calls the above method accordingly.

Program:

def countdown(n):#defining a method

   if n <= 0:#defining an if block that checks n value less than equal to 0

       print('Blastoff!')#print message

   else:#defining else block  

       print(n)#print number value

       countdown(n - 1)#calling method countdown

def countup(n):#defining countup method that takes one parameter

   if n >= 0:#defining if block that checks parameter value greater than equal to 0

       print('Blastoff!')#print message

   else:#defining else block

       print(n)#print the parameter value

       countup(n + 1)#Calling method countup

n = int(input("Enter an integer: "))   #defining n variable that inputs value

if n < 0:#defining if block that check n value less than 0

   countup(n)#Calling countup method

else:#defining else block  

   countdown(n)#Calling countdown method

Output:

Please find the attached file.

Learn more:

brainly.com/question/16999822

Throughout the semester we have looked at a number of C++ and Java examples. We have seen examples of iterators in both languages. You may have used iterators in other languages (e.g., Python or PHP). Briefly describe how iterators allow us to develop our ADT interfaces and work with ADT interfaces provided by others (e.g., the std::vector in C++ or java.util.ArrayList in Java).

Answers

Answer:

Check the explanation

Explanation:

Iterators in C++

==================

Iterators are used to point at the memory addresses of STL containers. They are primarily used in sequence of numbers, characters etc. They reduce the complexity and execution time of program.

Operations of iterators :-

1. begin() :- This function is used to return the beginning position of the container.

2. end() :- This function is used to return the after end position of the container.

// C++ code to demonstrate the working of

// iterator, begin() and end()

#include<iostream>

#include<iterator> // for iterators

#include<vector> // for vectors

using namespace std;

int main()

{

vector<int> ar = { 1, 2, 3, 4, 5 };

// Declaring iterator to a vector

vector<int>:: iterator ptr;

// Displaying vector elements using begin() and end()

cout << "The vector elements are : ";

for (ptr = ar. begin(); ptr < ar. end(); ptr++)

cout << *ptr << " ";

return 0;

}

Iterators in Java

==================

‘Iterator’ is an interface which belongs to collection framework. It allows us to traverse the collection, access the data element and remove the data elements of the collection.

java. util package has public interface Iterator and contains three methods:

boolean hasNext(): It returns true if Iterator has more element to iterate.

Object next(): It returns the next element in the collection until the hasNext()method return true. This method throws ‘NoSuchElementException’ if there is no next element.

void remove(): It removes the current element in the collection. This method throws ‘IllegalStateException’ if this function is called before next( ) is invoked.

// Java code to illustrate the use of iterator

import java. io.*;

import java. util.*;

class Test {

public static void main(String[] args)

{

ArrayList<String> list = new ArrayList<String>();

list. add("A");

list. add("B");

list. add("C");

list. add("D");

list. add("E");

// Iterator to traverse the list

Iterator iterator = list. iterator();

System. out. println("List elements : ");

while (iterator. hasNext())

System. out. print(iterator. next() + " ");

System. out. println();

}

}

Every class that implements Iterable interface appropriately, can be used in the enhanced For loop (for-each loop). The need to implement the Iterator interface arises while designing custom data structures.

Example:

for(Item item: customDataStructure) {

   // do stuff

}

To implement an iterable data structure, we need to:

Implement Iterable interface along with its methods in the said Data Structure

Create an Iterator class which implements Iterator interface and corresponding methods.

We can generalize the pseudo code as follows:

class CustomDataStructure implements Iterable<> {

// code for data structure

public Iterator<> iterator() {

return new CustomIterator<>(this);

}

}

class CustomIterator<> implements Iterator<> {

// constructor

CustomIterator<>(CustomDataStructure obj) {

// initialize cursor

}

// Checks if the next element exists

public boolean hasNext() {

}

// moves the cursor/iterator to next element

public T next() {

}

// Used to remove an element. Implement only if needed

public void remove () {

// Default throws Unsupported Operation Exception.

}

}

Note: The Iterator class can also, be implemented as an inner class of the Data Structure class since it won’t be used elsewhere.

As we discussed in class, with the explosion of huge volumes of unstructured data, a new breed of database technologies have emerged and have become popular. Clearly, these new database technologies like Dynamo, Bigtable, and Cassandra are critical technology to the companies that created them. Why did they allow their employees to publish academic papers about them? Why did they not keep them as proprietary secrets? (

Answers

1. The reason that Am..on (creator of Dynamo), G..gle (creator of Bigtable), and F...book (creator of Cassandra) allowed their employees to publish academic papers about the new breed of database technologies is that technologies were custom-made.

A custom-made technology is created specifically to meet some peculiar business strategies and cannot be utilized elsewhere.

2. The reason the companies did not keep these technologies as proprietary secrets is that other companies cannot use the technologies in their businesses since they were created to meet specific business requirements.

What are database technologies?

Database technologies are technologies that collect, store, organize, and process information and unstructured data for defined users. Some database technologies come in many shapes and sizes. Examples of database technologies include Dynamo, Bigtable, and Cassandra.

Learn more about database technologies at https://brainly.com/question/15334693

Final answer:

Companies like those who created Dynamo, Bigtable, and Cassandra published academic papers about their innovations to establish themselves as leaders, attract top talent, and foster adoption of their technologies as industry standards, despite the potential risk of giving away proprietary information.

Explanation:

The question asks why companies like those who created Dynamo, Bigtable, and Cassandra chose to publish academic papers about their database technologies, rather than keeping them as proprietary secrets. The decision to openly disclose information about these new database technologies can be attributed to several strategic advantages. First, publishing helps in establishing these companies as leaders in technological innovation, attracting top talent who want to work on cutting-edge projects. Furthermore, by sharing the innovations, these companies foster a community of developers who can contribute to the improvement of the technology, indirectly benefiting the original creators. Lastly, it encourages the adoption of their technologies as standards in the industry, which can lead to wider use and integration into other services, products, and technologies.

These reasons collectively contribute to why companies might decide to publish their innovations in the realm of big data and database technologies. Even though it might seem counterintuitive at first to share proprietary technologies, the long-term benefits of establishing industry standards, fostering a collaborative ecosystem, and attracting top talent can outweigh the risks of competitors gaining insights into their technologies.

Modify an array's elements Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. Ex: If minVal = 10, then dataSamples = [2, 12, 9, 20] becomes [4, 12, 18, 20]. Function Save Reset MATLAB DocumentationOpens in new tab function dataSamples = AdjustMinValue(numberSamples, userSamples, minValue) % numberSamples: Number of data samples in array dataSamples % dataSamples : User defined array % minValue : Minimum value of any element in array % Write a for loop that iterates from 1 to numberSamples to double any element's % value in dataSamples that is less than minValue dataSamples = userSamples; end 1 2 3 4 5 6 7 8 9 10 Code to call your function

Answers

Answer:

See explaination for program code

Explanation:

%save as AdjustMinValue.m

%Matlab function that takes three arguments

%called number of samples count, user samples

%and min vlaue and then returns a data samples

%that contains values which are double of usersamples

%that less than min vlaue

%

function dataSamples=AdjustMinValue(numberSamples, userSamples, minValue)

dataSamples=userSamples;

%for loop

for i=1:numberSamples

%checking if dataSamples value at index,i

%is less than minValue

if dataSamples(i)<minValue

%set double of dataSamples value

dataSamples(i)= 2*dataSamples(i);

end

end

end

Sample output:

Note:

File name and calling method name must be same

--> AdjustMinValue(4, [2,12,9,20],10)

ans =

4 12 18 20

Write a program that will create an array of Employees and calculate their weekly salary. For the employee structure you need to store eid, name, address, hourly Rate, total Hours, bonus, and, salary. You need to ask the user for the number of employees in the company. Then create an array of Employee structure of that size. Next, take details of all employees by creating a user-defined function named readEmployee. Next, compute the weekly salary of each employee and finally print into the output. Create two more user-define functions named Compute Salary and PrintEmployee to generate gross salary and print employee details into output. You have to store the result into a text file named EmployeeSalary.txt as well. [Note: You have to use Structure and File I/O. Use pointers wherever necessary.]

Answers

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <malloc.h>

typedef struct {

int eid;

char name[30];

char address[50];

float hourlyRate;

int totalHours;

float bonus;

float salary;

}employee;

void readEmployee(employee *employees, int size){

int i;

for(i = 0; i < size; ++i){

printf("Enter details of employee %d\n", i + 1);

printf("Enter eid: ");

scanf("%d", &employees[i].eid);

printf("Enter name: ");

scanf("%s", employees[i].name);

printf("Enter address: ");

scanf("%s", employees[i].address);

printf("Enter hourly rate: ");

scanf("%f", &employees[i].hourlyRate);

printf("Enter total hours: ");

scanf("%d", &employees[i].totalHours);

printf("Enter bonus percentage: ");

scanf("%f", &employees[i].bonus);

}

}

void ComputeSalary(employee *employees, int size){

int i;

for(i = 0; i < size; ++i){

employees[i].salary = (1 + (employees[i].bonus / 100.0)) * employees[i].hourlyRate * employees[i].totalHours;

}

}

void PrintEmployee(employee *employees, int size){

int i;

for(i = 0; i < size; ++i){

printf("Employee %d\n", i + 1);

printf("Eid: %d\n", employees[i].eid);

printf("Name: %s\n", employees[i].name);

printf("Address: %s\n", employees[i].address);

printf("Total hours: %d\n", employees[i].totalHours);

printf("Hourly rate: $%.2f\n", employees[i].hourlyRate);

printf("Bonus: %.2f%%\n", employees[i].bonus);

printf("Salary: $%.2f\n", employees[i].salary);

}

}

int main(){

int i, size;

employee *employees;

printf("Enter number of employees: ");

scanf("%d", &size);

employees = (employee *) malloc(sizeof(employee) * size);

readEmployee(employees, size);

ComputeSalary(employees, size);

PrintEmployee(employees, size);

return 0;

}

The WorkOrders table contains a foreign key, ClientNum, which must match the primary key of the Client table. What type of update to the WorkOrders table would violate referential integrity? If deletes do not cascade, what type of update to the Client table would violate referential integrity? If deletes do cascade, what would happen when a client was deleted?

Answers

Answer:

Changing the customer number on a record in the Orders table to a number that does not match a customer number in the customer table would violate referential integrity.

If deletes do not cascade, deleting a customer that has orders would violate referential integrity.

If deletes cascade, customer can be deleted and all orders for that customer will automatically be deleted.

1. Give state diagrams of DFAs recognizing the following languages. The alphabet is {0, 1}. (a) {w | w is any string except 11 and 111} (b) {w | every odd position of w is a 1}

Answers

Answer:

Explanation:

The first diagram shows the DFA that accepts that accepts any string except 11 and 111

The second diagram shows every odd position of w is 1

Consider the following line of code: if (x < 12 || (r – 3 > 12)) Write three valid mutants of this ground string (based on the rules of the Java/C# language), followed by three invalid mutants. You must use a different mutant operator for each mutant you create – list the abbreviation for the operator used next to each line (for example, write "ROR" if you used a Relational Operator Replacement).

Answers

Answer:

See explaination

Explanation:

Mutation Testing:

Mutation Testing is a type of software testing where we mutate (change) certain statements in the source code and check if the test cases are able to find the errors. It is a type of White Box Testing which is mainly used for Unit Testing. The changes in the mutant program are kept extremely small, so it does not affect the overall objective of the program.

We say a mutant is valid if it is syntactically correct. We say a mutant is useful if, in addition to being valid, its behavior differs from the behavior of the original program for no more than a small subset of program test cases.

VALID MUTANTS

1. if (x < 12 && (r – 3 > 12)) LOR

2. if (x < 12 || (r – 3 < 12)) ROR

3. if (x < 12 || (x – 3 < 12)) IVR

INVALID MUTANTS

1. if (x < 12 ||(r – 3 > 12) UPR

2. if (x < 12 (r – 3 < 12)) MLO

3. (x < 12 || (x – 3 < 12)) CSM

Note:

LOR: LOGICAL OPERATOR REPLACEMENT

ROR: RELATIONAL OPERATOR REPLACEMENT

IVR: INVALID VARIABLE REPLACEMENT

UPR: UNBALENCED PARANTHISIS REPLACEMENT

MLO: MISSING LOGICAL OPERATOR REPLACEMENT

CSM: CONTROL OPERATOR MISSING REPLACEMEN

Enter a formula in cell B25 to calculate the daily bill for Monday, July 29. The formula should calculate the total billable hours for the day (cell B23) times the billable rate (B4). Be sure to use an absolute cell reference for the billable rate.

Answers

Answer:

=($B$4 * B23)

Explanation:

Given

Billable Rate: B4

Total Billable Hours: B23

Required:

Daily Bill: B25

Write the following formula in cell B25

=($B$4 * B23)

The question asks that the cell for billable rate should be referenced using the absolute cell reference.

To use absolute reference in a cell, we start by writing a dollar sign and we also separate the cell name and the cell number with a dollar sign.

Hence, cell B4 becomes $B$4

Also, the question asks that the cell $B$4 be multiplied by cell B23.

To write a formula in Excel, we start by writing the equal to sign (=), then we continue with the expression itself

$B$4 multiplied by cell B23 will be written as $B$4 * B23

So, the full formula to calculate daily bill that'll be written in cell B25 becomes is =($B$4 * B23)

The Excel formula in cell B25 that can be used to calculate the daily bill for Monday, July 29 is =($B$4 × B23)

What is Excel Formula?

An excel formula represents the expression of a code in an Excel sheet that operates within a range of cell(s).

From the parameters  given:

The billable rate = B4The total Billable hours = B23

By using the absolute reference for billable rate, we need to begin the formula with a $ sign, the cell name in conjunction with the cell number is being separated by a $ sign.

Therefore, the cell in B4 can be written as:

$B$4

Now, multiplying it with cell in B23, we have using the excel formula method, we have:

=($B$4 × B23)

Learn more about the Excel Formula here:

https://brainly.com/question/25879801

PLEASE HELP

The equation SF=0 is the equation for

A. static equilibrium
B. dynamic equilibrium
C. Balanced forces
D. Tension

Answers

It’s C, balanced forces.

Write a program C statement to declare and initialize an array named afTest1 type float to store
5 test marks which are 90,30, 25, 45, 55. The program should print all the values that are stored
in the array.​

Answers

Answer:

#include <stdio.h>

int main()

{

   float afTest1[5] = {90, 30, 25, 45, 55};

   for (int i = 0; i < 5; i++) {

       printf("%f ", afTest1[i]);

   }

   return 0;

}

Explanation:

Initialize the elements of the array as 90, 30, 25, 45, 55

Create a for loop that iterates through the array

Inside the loop, print each element using printf function

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century".

Answers

Answer:

import java.util.Scanner;

public class num9 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter year");

       int givenYear =in.nextInt();

       if(givenYear>=2101){

           System.out.println("Distant Future");

       }

       else if(givenYear>=2001){

           System.out.println("21st Century");

       }

   }

}

Explanation:

Using Java programming LanguageImport Scanner class to receive user input of the variable givenYearUse if statement to check the first condition if(givenYear>=2101)Use else if statement to check the second condition if(givenYear>=2001)print Distant future and 21st century respectively

NOTE: Throughout this lab, every time a screenshot is requested, use your computer's screenshot tool, and paste each screenshot to the same Word document. Label each screenshot in accordance to the step in the lab. This document with all of the screenshots included should be uploaded through Connect as a Word or PDF document when you have reached the final step of the lab. In this lab, you will: 1. Identify questions related to the income statement. 2. Analyze a list of calculated financial ratios for a selection of companies. 3. Create a dynamic spreadsheet that pulls in XBRL data. 4. Create formulas to identify the companies based on the ratios. Refer to Chapter 8 pages 314 through 317 for instructions and steps for each of the lab parts. After completing Lab parts 1 through 4, complete the following requirements. Software needed Google Sheets (sheets.) iXBRLAnalyst script (https://findynamics/gsheets/ixbrlanalyst.gs) Data The data used in this analysis are XBRL-tagged data from Fortune 100 companies. The data are pulled from FinDynamics, which in turn pulls the data from the SEC.

Answers

Final answer:

The lab involves analysis of financial ratios, banking operations evaluation using T-account balance sheets, and quantitative modeling in biology, highlighting the importance of data analysis across disciplines.

Explanation:

The request refers to a step-by-step completion of a lab that involves interpreting financial data, specifically using an income statement to calculate various ratios for company analysis. The lab directs students to use specific data analysis tools and apply concepts such as the money multiplier and T-account balance sheets to evaluate banking operations. One part of the lab requires creating a spreadsheet to analyze data in terms of mass fractions relative to sodium, underlining the importance of quantitative modeling skills, even in biology.

Moreover, statistics play a role in the exercise, as students must calculate measures such as mean, standard deviation, median, and interquartile range. The lab encompasses a cross-disciplinary approach, including data analysis in biology and economics, showcasing how quantitative skills are leveraged in diverse fields.

Lastly, the lab also involves learning how to collect and interpret data, which includes skills like observation, sketching, using geography tools, and graphical interpretation. These fundamental skills are critical for successful data analysis in various academic and professional contexts.

In the simulation, player 2 will always play according to the same strategy. The number of coins player 2 spends is based on what round it is, as described below. (a) You will write method getPlayer2Move, which returns the number of coins that player 2 will spend in a given round of the game. In the first round of the game, the parameter round has the value 1, in the second round of the game, it has the value 2, and so on. The method returns 1, 2, or 3 based on the following rules. If round is divisible by 3, then return 3. If round is not divisible by 3 but is divisible by 2, then return 2. If round is not divisible by 3 and is not divisible by 2, then return 1. Complete method getPlayer2Move below by assigning the correct value to result to be returned.

Answers

Final answer:

To determine the number of coins that player 2 will spend in a given round of the game, check the rules based on the value of the round: divisible by 3 = 3 coins, divisible by 2 but not by 3 = 2 coins, not divisible by 3 and not divisible by 2 = 1 coin.

Explanation:

To determine the number of coins that player 2 will spend in a given round of the game, we need to check the rules based on the value of the round:

If the round is divisible by 3, player 2 will spend 3 coins.

If the round is not divisible by 3 but is divisible by 2, player 2 will spend 2 coins.

If the round is not divisible by 3 and not divisible by 2, player 2 will spend 1 coin.

So, the method getPlayer2Move should be defined as follows:

public

int getPlayer2Move(int round)

{

if (

round % 3 == 0) { return 3;

}

else if

(

round % 2 == 0

) {

return 2;

} else {

return 1;

} }

Final answer:

The getPlayer2Move method returns 1, 2, or 3 based on the given rules.

Explanation:

The method getPlayer2Move returns 1, 2, or 3 based on the rules given in the question. If the round number is divisible by 3, the method returns 3. If the round number is not divisible by 3 but is divisible by 2, the method returns 2. If the round number is not divisible by 3 and not divisible by 2, the method returns 1. For example, if the round number is 4, which is divisible by 2 but not divisible by 3, the method would return 2.

g Write a user-defined MATLAB function for the following math function: y ( x )=(−.2 x 3 +7 x 2 )e −.3x The input to the function is x and the output is y. Write the function such that x can be a vector (use element-by-element operations). a) Use the function to calculate y(-1.5) and y(5) b) Use the function to make a plot of the function y(x) for -2≤x≤6

Answers

Answer:

Go to explaination for the step by step answer.

Explanation:

a)Code

function[y]=operation(x) % this function takes x as input and returns y as output

y=(-0.2*x^3+7*x^2)*exp(-0.3*x)

end

% call this function in command widow by typing operation(value of x) like shown in figure in the first attachment.

b. write a code of above function in one script window and save the code with same name as name of function that is name of script should be saved as operation.Now copy paste the below code in new script window and run the code

clc

clear all

x=-2:.1:6

n=length(x)

for i=1:1:n

a=x(i)

y(i)=operation(a)

end

plot(y,x)

xlabel('X')

ylabel('Y')

Please kindly check attachment for pictorial answers that supports the code.

The function below takes a single string parameter: sentence. Complete the function to return a list of strings indicating which vowels (a, e, i, o, and u) are present in the provided sentence. The case of the vowels in the original sentence doesn't matter, but the should be lowercase when returned as part of the list. The order of the strings in the list doesn't matter. For example, if the provided sentence was 'All good people.', your code could return ['a', 'e', 'o']. It could also return ['e', 'o', 'a']. One way to implement this would be to use the filter pattern starting with the list of all vowels.

Answers

Answer:

import java.util.*;

public class num3 {

   public static void main(String[] args) {

   String sentence = "All good people";

       System.out.println("The vowels in the sentence are ");

       returnVowels(sentence);

   }

   public static void returnVowels(String word){

       String newWord = word.toLowerCase();

       String vowels ="";

       for (int i = 0; i < newWord.length(); i++){

           if(newWord.charAt(i)=='a'||newWord.charAt(i)=='e'||newWord.charAt(i)==i||

           newWord.charAt(i)=='o'||newWord.charAt(i)=='u'){

               vowels = vowels+newWord.charAt(i);

               //System.out.print(newWord.charAt(i)+" ");

           }

       }

     

       String [] chars = vowels.split("");

       Set<String> uniqueVowels = new LinkedHashSet<>();

       for (String s : chars) {

           uniqueVowels.add(s);

       }

       System.out.println(uniqueVowels);

   }

}

Explanation:

In Java

Create the method/function to receive a string as argument

Change the string to all small letters using the toLowerMethod

Iterate through the string using if statement identify the vowels and store in a new String

Since the sentence does not contain unique vowel characters, use the set collections in java to extract the unique vowels and print out

Daniel owns a construction company that builds homes. To help his customers visualize the types of homes he can build for them, he designs five different models on the computer, using 3D printing to develop 3D paper models. What type of technology is Daniel using to develop these 3D models

Answers

Final answer:

Daniel is employing Computer-Aided Design (CAD) software and 3D printing to create 3D models for his construction company. This allows for detailed, precise visualizations and virtual tours of home designs, aiding clients in understanding the end product before building commences.

Explanation:

Daniel is using Computer-Aided Design (CAD) software coupled with 3D printing technology to develop the 3D models. CAD software allows users to create detailed, precise representations of products, buildings, and other projects, which then can be used to create physical models through 3D printing. This method is widely utilized in various industries, including construction, architecture, and product design to facilitate visualization and prototyping. The realistic representations and simulations provided by today's CAD programs help professionals like Daniel to effectively communicate design concepts to clients without the need for traditional physical mock-ups, enhancing the design process significantly.

Through this technology, Daniel can construct virtual tours offering exact views of the architectural designs. These models not only help in visualizing the structures but also in making more informed decisions on the design before any actual construction begins. Daniel's utilization of technology for creating 3-dimensional paper models demonstrates how contemporary architectural practices leverage digital tools to bring concepts to life for both the design teams and their clients.

3. Assume a disk drive from the late 1990s is configured as follows. The total storage is approximately 675MB divided among 15 surfaces. Each surface has 612 tracks; there are 144 sectors/track, 512 bytes/sector, and 8 sectors/cluster. The disk turns at 3600 rpm. The tract-to-track seek time is 20ms, and the average seek time is 80ms. Now assume that there is a 360KB file on the disk. On average, how long does it take to read all of the data in the file? Assume that the first track of the file is randomly placed on the disk, that the entire file lies on adjacent tracks, and that the file completely fills each track on which it is found. A seek must be performed each time the I/O head moves to a new track. Show your calculations

Answers

Answer:

total time to read whole file = ( 81.380208 mili seconds ) + 80ms + 80ms

Explanation:

Size of a surface = 675/15 = 45 MB

Size of a track = (Number of sectors per track)*(Size of a sector)

= (144*512)Bytes

= 73.728 KB

Number of tracks where 360KB file is located = 360/73.728 = 4.8828125 (Approx 5 tracks)

So Seek time to go the first track of the file = 80 ms

And after seek time for track to track movement = 4*20 = 80 ms

We need 4.8828125 rotations to read whole file.

Time for 4.8828125 ratations = (60.0/3600.0)*4.8828125 seconds = 0.081380208 seconds = 81.380208 mili seconds

So total time to read whole file = ( 81.380208 mili seconds ) + 80ms + 80ms

6.1.3: Function call with parameter: Printing formatted measurement. Define a function PrintFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a newline. Ex: PrintFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote.

Answers

Answer:

public class Main

{

public static void main(String[] args) {

 PrintFeetInchShort(5, 8);

}

public static void PrintFeetInchShort(int numFeet, int numInches) {

    System.out.println(numFeet + "'" + " " + numInches + "\"");

}

}

Explanation:

Create a function called PrintFeetInchShort that takes two parameters, numFeet, and numInches

Print the given values in required format. Use System.out.println to print the values, ends with a new line.

Inside the main, call the function with two integers as seen in the example

Our goal here is to predict whether an accident just reported will involve an injury (MAX_SEV_IR = 1 or 2) or will not (MAX_SEV_IR = 0). For this purpose, create a dummy variable called INJURY that takes the value "yes" if MAX_SEV_IR = 1 or 2, and otherwise "no."

Answers

Explanation:

The outlines given in question statement can be written in many programming languages. The below program would be written in C language, which is one of the basic computer languages

Program code

String main (int MAX_SEV_IR)

{

string INJURY

if (MAX_SEV_IR = =1 or MAX_SEV_IR == 2)

INJURY = "yes"

elseif (MAX_SEV_IR = =0)

INJURY = "No"

else

INJURY = "Invalid data"

return INJURY

}

Answer:

# main function is defined

def main():

# the value of MAX_SEV_IR is gotten

# from the user via keyboard input

MAX_SEV_IR = int(input ("Enter MAX_SEV_IR: ")

# if statement to check for prediction

# if MAX_SEV_IR == 1 or 2

# then there is injury and it is displayed

if (MAX_SEV_IR == 1 or MAX_SEV_IR == 2):

print("INJURY = ", injury)

print("PREDICTION: Accident just reported will involve an injury")

# else if MAX_SEV_IR == 0 then no

# injury and it is displayed

elif (MAX_SEV_IR == 0):

injury = "NO"

print("INJURY = ", injury)

print("PREDICTION: Accident just reported will not involve an injury")

# the call main function to execute

if __name__ = '__main__':

main()

Explanation:

The code is written in Python and well commented.

Other Questions
The outer banks of North Carolina or barrier islands that are subject to season of hurricanes and flooding houses constructed along the shoreline and beaches of the Outer Banks would be most similar to houses in which of the following locations Mr. Thompson wants to tile his living room which measures 15.7 feet in length and 12.2 feet in width. What is the area of Mr. Thompsons living room?b) If tile costs $10.50 per square foot, how much will it cost Mr.Thompson to tile his living room. What is the arithmetic mean of the following numbers? 3, 5, 6, 2, 9 Given a+b=7 and ab=3, find:3^a/3^b conomics FWISDIncreasing the Money SupplyChoose the best word or phrase from each drop-down menu.The Federal Reserve increases the money supply when it is trying to encourage the economy to _____Consumers are more willing to spend using credit when the money supply is higher because interest rates are______One major positive effect of increasing the money supply isin the unemployment rate___ A circus act involves a trapeze artist and a baby elephant. They are going to balance on a teeter-totter that is 10 meters long and pivoted at the middle. The lady has a weight of 500 newtons and is standing on one end. The elephant has a weight of 2500 N and is walking toward her on the beam. How far does the elephant have to walk from the end toward the middle to balance the beam How does the risk of needing insurance impact the cost of premiums?A. In some cases, higher risk results in lower costs.B. Higher risk always results in lower costs.C. Higher risk always results in higher costs.D. In some cases, higher risk results in higher costs. Sharon bought a mixture of nuts that was made up of pecans, walnuts and cashews in a ratio by weight of $2:3:1$, respectively. If she bought $9$ pounds of nuts, how many pounds of walnuts were in the mixture? Express your answer as a decimal to the nearest tenth. 2.Mike's car, which has a mass of 1,000.0 kg, is out of gas. Mike is trying to push the car toa gas station, and he makes the car go 0.05 m/s/s. Using Newton's Second Law, you cancompute how much force Mike is applying to the car. HELP ASAP PLEASE!!!What is the median for the following set of data?5, 7, 9, 11, 13, 13A. 10B. 8C.9D.11 What is an example of an interest leading to a career choice?A. An interest in animals leads to a career in marketing.B. An interest in music leads to a career in zoology.C. An interest in helping others leads to a career in medicine.D. An interest in science leads to a career in hospitality. The times a fire department takes to arrive at the scene of an emergency are normally distributed with a mean of 6 minutes and a standard deviation of 1 minute. For about what percent of emergencies does the fire department arrive at the scene in between 4 minutes and 8 minutes ? Help number 8 Please help Paint that uses a vehicle made of wax is called _______ Explain the historical circumstances that led to Mao Zedongs delivery of the speech entitled Proclamation of the Central Peoples Government of the Peoples Republic of China. What is the main purpose of "Eileen Collins NASA's First Female Shuttle Commander to Lead Next Shuttle Mission"?to inform readers about Eileen Collins' career and her views on space travelto convince readers that Eileen Collins should command a shuttle missionto show readers the type of leadership that Eileen Collins demonstratesto highlight for readers the hardships that Eileen Collins overcame he manager of the student center cafeteria, has added pizza to the menu. The pizza is ordered frozen from a local pizza establishment and baked at the cafeteria. She anticipates a weekly demand of 10 pizzas. The cafeteria is open 45 weeks per year. The ordering cost if $15 and the holding cost is $0.40 per pizza per year. The pizza vendor has a one week lead-time and the manager wants to maintain 1 pizza for safety stock. What is the optimal reorder point What effect does the resolution have on the overall meaning of the passage in the yellow wallpaper Joseph opens a checking account with $400. each month he adds $150 to the account wright an equation representing the total amount A in the account at the end of any given month M 2. How much work does it take to accelerate a 6.6 kg object from rest to 22 m/s?O a) 73 Jb) 960 Jc) 1600Jd) 3200 Je) 0.30 J