Write the class "Tests". Ensure that it stores a student’s first name, last name, all five test scores, the average of those 5 tests’ scores and their final letter grade. (Use an array to store all test scores.)

Answers

Answer 1

Answer:

The following assumption will be made for this assignment;

If average score is greater than 75, the letter grade is AIf average score is between 66 and 75, the letter grade is BIf average score is between 56 and 65, the letter grade is CIf average score is between 46 and 55, the letter grade is DIf average score is between 40 and 45, the letter grade is EIf average score is lesser than 40, the letter grade is F

The program is written in Java and it uses comments to explain difficult lines. The program is as follows

import java.util.*;

public class Tests

{

public static void main(String [] args)

{

 //Declare variables

 Scanner input = new Scanner(System.in);

 String firstname, lastname;

 //Prompt user for name

 System.out.print("Enter Lastname: ");

 lastname = input.next();

 System.out.print("Enter Firstname: ");

 firstname = input.next();

 char grade;

 //Declare Array

 int[] Scores = new int[5];

 //Initialize total scores to 0

 int total = 0;  

  //Decalare Average

  double   average;

 //Prompt user for scores

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

 {

  System.out.print("Enter Score "+(i+1)+": ");

  Scores[i] = input.nextInt();

  //Calculate Total Scores

  total+=Scores[i];

 }

 //Calculate Average

 average = total/5.0;

 //Get Letter Grade

 if(average>75)

 {

 grade = 'A';

 }

 else if(average>65)

 {

 grade = 'B';

 }

 else if(average>55)

 {

 grade = 'C';

 }

 else if(average>45)

 {

 grade = 'D';

 }

 else if(average>40)

 {

 grade = 'E';

 }

 else

 {

 grade = 'F';

 }

 //Print Student Results

 System.out.print("Fullname: "+lastname+", "+firstname);

 System.out.print('\n');

 System.out.print("Total Scores: "+total);

 System.out.print('\n');

 System.out.print("Average Scores: "+average);

 System.out.print('\n');

 System.out.print("Grade: "+grade);

}

}

See Attachment for .java file


Related Questions

Write a program that lets the Michigan Popcorn Company keep track of their sales for seven different types of popcorn they produce: plain, butter, caramel, cheese, chocolate, turtle and zebra. It should use two parallel seven-element arrays: an array of strings that holds the seven popcorn names and an array of integers that holds the number of bags of popcorn sold during the past month for each popcorn flavor. The names should be stored using an initialization list at the time the flavors array is created. The program should prompt the user to enter the number of bags sold for each flavor. Once the popcorn data has been entered, the program should produce a report for each popcorn type, total sales, and the names of the highest selling and lowest selling products. Be sure to include comments throughout your code where appropriate. Complete the C++ code using Visual Studio or Xcode, compress (zip) and upload the entire project folder to the Blackboard assignment area by clicking on the Browse My Computer button or by dragging the file inside the Attach Files box g

Answers

Answer:

#include <iostream>using namespace std;int main(){    // declare and initialize popcorn name array    string popcorn_name[7] = {"plain", "butter", "caramel", "cheese", "chocolate", "turtle", "zebra"};    // declare and initialize sales array with 7 elements    int sales[7];        // A loop to prompt user to enter sales for each popcorn    for(int i=0; i < 7; i++){        cout<<"Enter number of sales for " + popcorn_name[i] + " :";        cin>>sales[i];    }        // Find maximum sales    int max = sales[0];    int maxIndex = 0;    for(int j=1; j < 7; j++){        if(max < sales[j]){            max = sales[j];            maxIndex = j;        }    }        // Find minimum sales    int min = sales[0];    int minIndex = 0;    for(int k=1; k < 7; k++){        if(min > sales[k]){            min = sales[k];            minIndex = k;        }    }        // Print popcorn name and sales    for(int l=0; l < 7 ; l++){        cout<<popcorn_name[l]<<"\n";        cout<<"Sales: "<< sales[l]<<"\n\n";    }        // Print popcorn name with maximum and minimum sales    cout<<"Highest selling: "<< popcorn_name[maxIndex]<<"\n";    cout<<"Lowest selling: "<<popcorn_name[minIndex]<<"\n";    return 0;}

Explanation:

Create two arrays to hold the list of popcorn name and their sales (Line 5-8). Next prompt user to input the sales for each popcorn (Line 10-14). Get the maximum sales of the popcorn (Line 17-24) and minimum sales (Line 27-34). Print the popcorn name and sales (Line 37-40) and the popcorn name with highest and lowest selling (Line 43-44).

1. Implement the function dict_intersect, which takes two dictionaries as parameters d1 and d2, and returns a new dictionary which contains only those keys which appear in both d1 and d2, whose values are a tuple of the corresponding values from d1 and d2.

E.g., dict_intersect({'a': 'apple', 'b': 'banana'}, {'b': 'bee', 'c': 'cat'}) should return {'b': ('banana', 'bee')}

2. Implement the function consolidate, which accepts zero or more sequences in the star parameter seqs, and returns a dictionary whose keys consist of values found in those sequences, which in turn map to numbers indicating how many times each value appears across all the sequences.

E.g., consolidate([1,2,3], [1,1,1], [2,4], [1]) should return the dictionary {1: 5, 2: 2, 3: 1, 4: 1}.

Answers

Answer:

1  

def dict_intersect(d1,d2): #create dictionary

  d3={} #dictionaries

  for key1,value1 in d1.items():       #iterate through the loop  

      if key1 in d2:   #checking condition

          d3[key1]=(d1[key1],d2[key1])   #add the items into the dictionary  

  return d 3

print(dict_intersect({'a': 'apple', 'b': 'banana'}, {'b': 'bee', 'c': 'cat'})) #display

2

def consolidate(*l1):  #create consolidate

  d3={} # create dictionary

  for k in l1:       #iterate through the loop

      for number in k:   #iterate through  the loop                               d3[number]=d3.get(number,0)+1   #increment the value

             return d 3 #return

print(consolidate([1,2,3], [1,1,1], [2,4], [1])) #display

Explanation:

1

Following are  the description of program

Create a dictionary i.e"dict_intersect(d1,d2) "   in this dictionary created a dictionary d3 .After that iterated the loop and check the condition .If the condition is true then add the items into the dictionary and return the dictionary d3 .Finally print them that are specified in the given question .

2

Following are  the description of program

Create a dictionary  consolidate inside that created a dictionary "d3" .After that iterated the loop outer as well as inner loop and increment the value of items .Return the d3 dictionary and print the dictionary as specified in the given question .

A new operating system uses passwords that consist of three characters. Each character must be a digit between 0 and 9. For example, three distinct possible passwords are 123, 416, and 999. The system uses 32-bit salt values. The system also allows one login attempt every second and never locks out users regardless of how many failed attempts occur. If an adversary has obtained a copy of the password file and conducts an offline brute-force attack by trying every password combination until the adversary obtains username and password combination. The use of a 32-bit salt value

Answers

Answer:

Brute force is  technique that is used for cracking password

In this case the system uses only three characters(0-9). By applying Brute force attack in "hit and try" manner we easily crack the password.

Explanation:

Solution

There are a wide variety of password cracking mechanisms.Brute force is one of the popular password cracking technique.Brute force attack is generally used to crack small passwords.

In the given example the system uses only three characters(0-9).By using Brute force attack in "hit and try" manner we easily crack the password.There are only 10 possible passwords for this type of system.Because we can arrange 0-9 only in 10 ways.But for Systems with long passwords it is difficult to find it in hit and try manner.But instead of having plain password each password have a random salt value.

In a system of 32 bit salt value there are 2^32 different key values.

By increasing the salt value from 32 bits to 64 bits there are 2^64 different key values.It increases the time taken to crack a password for an attacker.so by changing salt value from 32 to 64 bits will make it more harder for the adversary's attack to be successful.

Which of the following is true about operating system.

a. acts as an intermediary between the computer user and the computer hardware.
b. program that manages the computer hardware.
c. provides a basis for application progra

Answers

Answer:

google kis kam ka hai us se puch lo

What is a manifold on a vehicle

Answers

Answer:

the part of an engine that supplies the fuel/air mixture to the cylinders

Explanation:

There is also an exhaust manifold that collects the exhaust gases from multiple cylinders into a smaller number of pipes

Larry sees someone he finds annoying walking toward him. Larry purposely looks away and tries to engage in conversation with someone else. Which type of eye behavior is Larry using?
a. mutual lookingb. one-sided lookingc. gaze aversiond. civil inattentione. staring

Answers

Answer:

one-sided looking

Explanation:

Larry purposely looks away

Which of the following statements about CASE is not true?CASE tools provide automated graphics facilities for producing charts.CASE tools reduce the need for end user participation in systems development.CASE tools have capabilities for validating design diagrams and specifications.CASE tools support collaboration among team members.CASE tools facilitate the creation of clear documentation

Answers

Answer:

CASE tools reduce the need for end user participation in systems development.

Explanation:

CASE is an acronym for Computer-aided Software Engineering and it comprises of software application tools that provide users with automated assistance for Software Development Life Cycle (planning, analysing, designing, testing, implementation and maintenance). The CASE tools helps software developers in reducing or cutting down of the cost and time of software development, as well as the enhancement of the software quality.

Some other benefits of using the CASE tools are;

- CASE tools provide automated graphics facilities for producing charts.

- CASE tools have capabilities for validating design diagrams and specifications.

- CASE tools support collaboration among team members.

- CASE tools facilitate the creation of clear documentation.

- CASE tools checks for consistency, syntax errors and completeness.

The CASE tools can be grouped as, requirement and structure analysis, software design, test-case and code generation, reverse engineering, and document production tools.

Examples of CASE tools are flowchart maker, visible analyst (VA), dreamweaver, net-beans, microsoft visio, adobe illustrator and photoshop etc.

import java.util.Scanner; public class ArraySum { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); final int NUM_ELEMENTS = 8; // Number of elements int[] userVals = new int[NUM_ELEMENTS]; // User numbers int i = 0; // Loop index int sumVal = 0; // For computing sum // Prompt user to populate array System.out.println("Enter " + NUM_ELEMENTS + " integer values..."); for (i = 0; i < NUM_ELEMENTS; ++i) { System.out.print("Value: "); userVals[i] = scnr.nextInt(); } // Determine sum sumVal = 0; for (i = 0; i < NUM_ELEMENTS; ++i) { sumVal = sumVal + userVals[i]; } System.out.println("Sum: " + sumVal); return; } }

Answers

Answer:

There's nothing wrong with the question you posted except that it's not well presented or arranged.

When properly formatted, the program will be error free and it'll run properly.

The programming language used in the question is Java programming lamguage.

in java, the sign ";" signifies the end of each line and lines that begins with // represent comments. Using this understanding of end of lines and comments, the formatted code goes thus

import java.util.Scanner;  

public class Arraysum {  

public static void main(String[] args) {  

Scanner scnr = new Scanner(System.in);  

final int NUM_ELEMENTS = 8;

// Number of elements  

int[] userVals = new int[NUM_ELEMENTS];  

// User numbers  

int i = 0;  

// Loop index  

int sumVal = 0;  

// For computing sum  

// Prompt user to populate array  

System.out.println("Enter " + NUM_ELEMENTS + " integer values...");  

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

System.out.print("Value: ");  

userVals[i] = scnr.nextInt();  

}  

// Determine sum  

sumVal = 0;

for (i = 0; i < NUM_ELEMENTS; ++i)

{

sumVal = sumVal + userVals[i];

}

System.out.println("Sum: " + sumVal); return;

}

}

Also, see attachment for source file

The following numbers are inserted into a linked list in this order:
10, 20, 30, 40, 50, 60
What would the following statements display?
pCur = head->next;
cout << pCur->data << " ";
cout << pCur->next->data << endl;
a) 20 30
b) 40 50
c) 10 20
d) 30 40

Answers

Answer:

A. 20 30

Explanation:

Given

Linked list: 10, 20, 30, 40, 50, 60

Required

The output of the following code segment

pCur = head->next;

cout << pCur->data << " ";

cout << pCur->next->data << endl;

A linked list operates by the use of nodes which begins from the head to the next node, to the next, till it reaches the last;

The first line of the code segment; "pCur = head->next; " shifts the node from the head to the next node

The head node is the node at index 0 and that is 10;

This means that the focus has been shifted to the next at index 1 and that is 20;

So, pCur = 20

The next line of the code segment; cout << pCur->data << " "; prints pCur and a blank space

i.e. "20 " [Take note of the blank space after 20]

The last line "cout << pCur->next->data << endl; " contains two instructions which are

1. pCur = next->data;

2. cout<<pCur->data;

(1) shifts focus to the next node after 20 ; This gives pCur = 30

(2) prints the value of pCur

Hence, the output of the code segment is 20 30

Write a program that asks the user to enter either an "African" or a "European" swallow. The programâs behaviour should mimic the program below. If the user enters something øther than "African" or "European", the program shøuld insult the user like the example below.

Sample Output #1:

What kind of swallow?
African
Yes, it could grip it by the husk.

Sample Output #2:

What kind of swallow?
European
A five-ounce bird could not carry a one-pound coconut.

Sample Output #3:

What kind of swallow?
Spanish
You really are not fit to be a king.

Answers

Answer:

The programming language is not stater; However, I'll answer this question using C++.

This program does not use comments (See explanation)

See Attachment for program file

Program starts here

#include <iostream>

using namespace std;

int main()

{

string response;

cout<<"What kind of swallow?\n";

cin>>response;

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

{

 response[i]=toupper(response[i]);

}

   if(response == "AFRICAN")

   {

    cout<<"Yes, it could grip it by the husk.";

}

else if(response == "EUROPEAN")

   {

    cout<<"A five-ounce bird could not carry a one-pound coconut.";

}

else

{

 cout<<"You really are not fit to be a king.";

}

   return 0;

}

Explanation:

string response; -> A string variable to hold user input is declared

cout<<"What kind of swallow?\n"; -> prompts user for input

cin>>response; -> user input is stored here

The following iteration converts user input to uppercase; so that the program will work for inputs like African, AFRICAN, AFriCAN, etc.

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

{

 response[i]=toupper(response[i]);

}

The following if statement prints "Yes, it could grip it by the husk." if user input is AFRICAN

   if(response == "AFRICAN")

   {

    cout<<"Yes, it could grip it by the husk.";

}

Otherwise, if user input is EUROPEAN, it prints; "A five-ounce bird could not carry a one-pound coconut."

else if(response == "EUROPEAN")

   {

    cout<<"A five-ounce bird could not carry a one-pound coconut.";

}

Lastly; for every inputs different from AFRICAN and EUROPEAN, the program displays "You really are not fit to be a king."

else

{

 cout<<"You really are not fit to be a king.";

}

Charles Montesquieu believed that the
Legislative Branch should do what?
A. Make laws
B. Enforce laws
C. Interpret laws
elles sone. All Rights Resed.​

Answers

Answer:

A. Make Laws

Explanation:

Montesquieu believed the ways to go about limiting the power of a monarch would be to split up power among 3 groups, Judicial, Legislative and Executive. The American Presidential system and Constitution used Montesquieu's writings as a foundation for their principles.

Judicial Interprets lawsLegislative Makes lawsExecutive Enforces Law

A. make laws ........ sorry for all the dots have to make it longer :/

Write a Java program that reads from the user four grades between 0 and 100. The program the, on separate ines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Make sure to properly label your output. Use escape characters to line up the outputs after the labels.

Answers

Answer:

import java.util.*;

public class Grade {

   

   public static void main(String[] args) {

     

       Scanner input = new Scanner(System.in);

       double[] grades =  new double[4];

       

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

           System.out.print("Enter a grade: ");

           grades[i] = input.nextDouble();

       }

       

       double lowest = grades[0];

       double highest = grades[0];

       double total = 0;

       

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

           System.out.println("Grade " + (i+1) + " is: "  + grades[i]);

           

           if(grades[i] >= highest)

               highest = grades[i];

           if(grades[i] <= lowest)

               lowest = grades[i];

           

           total += grades[i];

           

       }

       double average = total/4;

       

       System.out.println("The highest grade is: " + highest);

       System.out.println("The lowest grade is: " + lowest);

       System.out.println("The average is: " + average);

  }

}

Explanation:

Ask the user for the grades and put them in the grades array using a for loop

Create another for loop. Inside the loop, print the grades. Find highest and lowest grades in the grades array using if-structure. Also, add each grade to the total.

When the loop is done, calculate the average, divide the total by 4.

Print the highest grade, lowest grade and average.

Three examples of parameter-parsing implementation models are: (1)________, (2)________, and (3)________.

Answers

Answer:1) Parse-by-value

2) Parse-by-reference

3) Parse-by-name

Explanation: Parameter parsing refers to a communication among procedures or functions.

The values of a variable procedure are transferred to the called procedure by some mechanisms. Different techniques of parameter-parsing include; parse-by-value, parse-by-reference, parse-by-copy restore, parse-by-name.

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between (and including) 0 and 9. End with a newline. Ex: 5 7 Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
GIVEN:
#include
#include // Enables use of rand()
#include // Enables use of time()
int main(void) {
int seedVal = 0;
/* Your solution goes here */
return 0;
}
2). Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
101
133
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, srand() has already been called; do not call srand() again.
GIVEN:
#include
#include // Enables use of rand()
#include // Enables use of time()
int main(void) {
int seedVal = 0;
seedVal = 4;
srand(seedVal);
/* Your solution goes here */
return 0;
}

Answers

Answer:

1. The solution to question 1 is as follows;

srand(seedVal);

cout<<rand()%10<<endl;

cout<<rand()%10<<endl;

2. The solution to question 2 is as follows

cout<<100+rand()%50 <<endl;

cout<<100+rand()%50 <<endl;

Explanation:

The general syntax to generate random number between interval is

Random Number = Lower Limit + rand() % (Upper Limit - Lower Limit + 1)

In 1;

The solution starts by calling srand(seedVal);

The next two statements is explained as follows

To print two random integers between intervals of 0 and 9 using rand()"

Here, the lower limit = 0

the upper limit =  9

By substituting these values in the formula above; the random number will be generated as thus;

Random Number = 0 + rand() % (9 - 0 + 1)

Random Number = 0 + rand() % (10)

Random Number = rand() % (10)

So, the instruction to generate the two random variables is rand() % (10)

2.

Similar to 1 above

To print two random integers between intervals of 100 and 149 using rand()"

Here, the lower limit = 100

upper limit = 149

By substituting these values in the formula above; the random number will be generated as thus;

Random Number = 100 + rand() % (149 - 100 + 1)

Random Number = 100 + rand() % (50)

So, the instruction to generate the two random variables is 100 + rand() % (50)

what is computer aided design​

Answers

Computer-aided design (CAD) is the use of computers (or workstations) to aid in the creation, modification, analysis, or optimization of a design.[1] CAD software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing. hope this helps!!!

TCPDump is used by Wireshark to capture packets while Wireshark own function is:

a. to provide a graphical user interface (GUI) and several capture filters.
b. to act as an intrusion prevention system (IPS) by stopping packets from a black-listed website or packets with payloads of viruses.
c. to defend the network against TCP SYN Flooding attacks by filtering out unnecessary TCP packets.
d. yet to be defined.

Answers

Answer:

a. to provide a graphical user interface (GUI) and several capture filters

Explanation:

TcPDump is a command line tool used to capture packets. TcPDump is used to filter packets after a capture has been done. To control network interfaces, TcPDump need to be assigned root privileges. Data is represented in form of text

Wireshark provide a graphical user interface (GUI) and several capture filters. It is a graphical tool used in packet capture analysis. Data is represented in wireshark as text in boxes.

Consider that a large online company that provides a widely used search engine, social network, and/or news service is considering banning ads for the following products and services from its site: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks. Which, if any, do you think they should ban? Give reasons. In particular, if you select some but not all, explain the criteria for distinguishing.

Answers

Answer:

I think that they should ban ads for all four products.  These products, e-cigarettes, abortion clinics, ice cream, and sugared soft drinks, are all discreet adult products that should not be advertised because of their health hazards.  Since the "large online company provides a widely used search engine, social network, and/or news service, which are mainly patronized by younger people, such ads that promote products injurious to individual health should be banned.  Those who really need or want these products know where they could get them.  Therefore, the products should not be made easily accessible to all people.  Nor, should ads promote their patronage among the general population.

Explanation:

Advertisements create lasting and powerful images which glamourize some products, thereby causing the general population, especially children, to want to consume them without any discrimination of their health implications.  If online banning is then contemplated, there should not be any distinguishing among the four products: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks.

During an investigation of a cybercrime, the law enforcement officers came across a computer that had the hard drive encrypted. Chose the best course of action they should take to access the data on that drive.
a. Use image filtering techniques to see what's behing the encrypted files.
b. Try to convince the owner of the computer to give you to decryption key/password.
c. Identify the encryption algorithm and attempt a brute force attack to get access to the file.
d. Disconnect the hard drive from power so the encryption key can be exposed on the next power up.
e. Try to copy the drive bit by bit so you can see the files in each directory.

Answers

Answer:

b. Try to convince the owner of the computer to give you to decryption key/password.

Explanation:

Encrypted hard drives have maximum security and high data protection. to access them you need to enter a password to unlock them.

The image filtering technique is a method that serves to selectively highlight information contained in an image, for which it does not work.

The encryption algorithm is a component used for the security of electronic data transport, not to access data on an encrypted hard drive.

The encryption key is used in encryption algorithms to transform a message and cannot be exposed by disconnecting the hard drive from its power source.

What program is best for teaching young people code?

Answers

I’d probably say scratch, Its great for young people to learn how to code. Lots of things you can do and make with it.

Consider a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is. What network architecture is the best fit for this problem

Answers

Answer:

Many-to-one (multiple inputs, single output)

Explanation:

Solution

In the case of a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is, the RNN will listen to the audio and will give result by doing classification.

There will be a single output, for the classified or say identified person.

The RNN will take a stream of input as the input is a audio speech sample.

Therefore, there will be multiple inputs to the RNN and a single output, making the best fit Architecture to be of type Many-to-one(multiple inputs, single output).

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. Ex: If the input is: hey hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1

Answers

Answer:

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

Explanation:

This program that we are told to write will be done by using python programming language/ High-level programming language.

The question wants us to write a program in which the output will be as below;

hey 1

hi 2

Mark 1

hi 2

mark 1

Just by imputing hey hi mark hi mark.

Just copy and run the code below.

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

In this exercise we have to use the knowledge in computational language in python to write the following code:

We have the code can be found in the attached image.

So in an easier way we have that the code is

input_list = input()

list = input_list.split()

for word in list:

frequency=list.count(word)

print(word,frequency)

See more about python at brainly.com/question/18502436

Write a function called unzip that takes as parameter a sequence (list or tuple) called seq of tuples with two elements. The function must return a tuple where the first element is a list with the first members of the seq tuple and the second element is a list with the second members of the seq tuple.
This example clarifies what is required:
Ist =[(1, "one"), (2, "two"), (3, "three")]
tup= unzip(Lst) lst tup
print(tup)
#prints ([1, 2, 3], ['one', two','three'7)

Answers

Answer:

Here is the function unzip:

def unzip(lst):

   result= zip(*lst)

   return list(result)

The complete program in Python is given below:

def unzip(lst):

   result= zip(*lst)

   return list(result)

   

lst =[(1, "one"), (2, "two"), (3, "three")]

tup= unzip(lst)

print(tup)

Explanation:

Here zip() function is used in the unzip function. The return type of zip() function is a zip object. This means the function returns the iterator of tuples. This function can be used as its own inverse by using the * operator.

If you do not want to use zip() function then the above program can also be implemented as following which uses a for loop for elements in the given list (lst). This can make a pair of lists (2 tuple) instead of list of tuples:

def unzip(lst):

   output = ([ a for a,b in lst ], [ b for a,b in lst ])

   return output

   

lst =[(1, "one"), (2, "two"), (3, "three")]  

tup= unzip(lst)  

print(tup)

The programs along with their output are attached.

A vSphere Administrator is receiving complaints a database VM is experiencing performance issues. The VM is a member of the high priority resource pool and the cluster has not experienced contention.
Which condition should be checked to address immediate performance concerns?
A. VM snapshots
B. VMFS version
C. Resource Pool share value
D. Configured CPU shares

Answers

Answer:

C. Resource Pool share value.

Explanation:

The vSphere is a term used to describe the VMware’s virtualization cloud platform. The vSphere comprises of the following, vCenter Server, ESXi, Virtual Machine File System (VMFS) and vCenter Client.

If a vSphere Administrator receive complaints that a database Virtual Machine (VM) is experiencing performance issues and the Virtual Machine (VM) is a member of the high priority resource pool and the cluster has not experienced contention.

In order to address immediate performance concerns, the vSphere Administrator should check the Resource Pool share value.

VMware resource pool refers to the aggregated central processing unit and memory allocated to a Virtual Machine (VM) for flexible management of the resources.

Also, the vSphere Administrator should install VMware tools to check which processes are having high CPU usage by using vimtop, as well as checking if vCenter Server is swapping.

C++ Problem: In the bin packing problem, items of different weights (or sizes) must be packed into a finite number of bins each with the capacity C in a way that minimizes the number of bins used. The decision version of the bin packing problem (deciding if objects will fit into <= k bins) is NPcomplete. There is no known polynomial time algorithm to solve the optimization version of the bin packing problem. In this homework you will be examining three greedy approximation algorithms to solve the bin packing problem.

- First-Fit: Put each item as you come to it into the first (earliest opened) bin into which it fits. If there is no available bin then open a new bin.

- First-Fit-Decreasing: First sort the items in decreasing order by size, then use First-Fit on the resulting list.

- Best Fit: Place the items in the order in which they arrive. Place the next item into the bin which will leave the least room left over after the item is placed in the bin. If it does not fit in any bin, start a new bin.

Implement the algorithms in C++. Your program named bins.cpp should read in a text file named bin.txt with multiple test cases as explained below and output to the terminal the number of bins each algorithm calculated for each test case. Example bin.txt: The first line is the number of test cases, followed by the capacity of bins for that test case, the number of items and then the weight of each item. You can assume that the weight of an item does not exceed the capacity of a bin for that problem.

3

10

6

5 10 2 5 4 4

10

20

4 4 4 4 4 4 4 4 4 4 6 6 6 6 6 6 6 6 6 6

10

4

3 8 2 7

Sample output: Test Case 1 First Fit: 4, First Fit Decreasing: 3, Best Fit: 4

Test Case 2 First Fit: 15, First Fit Decreasing: 10, Best Fit: 15

Test Case 3 First Fit: 3, First Fit Decreasing: 2, Best Fit: 2

Answers

xekksksksksgBcjqixjdaj

Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, or a total of $650. Write an app (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is an integer). a) $200–299
b) $300–399
c) $400–499
d) $500–599
e) $600–699
f) $700–799
g) $800–899
h) $900–999
i) $1000 and over
Summarize the results in tabular format.

Answers

Answer: Provided in the explanation section

Explanation:

import java.util.Scanner;

public class commission

{

   public static void main(String[] args) {

      Scanner input = new Scanner(System.in);

        int totals[]={0,0,0,0,0,0,0,0,0};          

      int n,sales,i,index;

       double salary;

        System.out.print("how many salesmen do you have? ");                          

      n=input.nextInt();

        for(i=1;i<=n;i++)

           {System.out.print("Salesman "+i+" enter sales: ");

            sales=input.nextInt();

            salary=200+(int)(.09*sales);

               System.out.printf("Salary=$%.2f\n",salary);

            index=(int)salary/100-2;

            if(index>8)

                index=8;

            totals[index]++;

            }

        System.out.println("SUMMARY\nSALES\t\tCOUNT");

        for(i=0;i<8;i++)

           System.out.println("$"+(i*100+200)+"-"+(i*100+299)+"\t"+totals[i]);

        System.out.println("$1000 and over\t"+totals[i]);

       }                                

   }

 

cheers i  hope this helped !!      

Describe and list advantages and disadvantages of each of the following backup types:

full, differential, incremental, selective, CPD, and cloud. ​

Answers

Answer:

Full back up

It creates complete copy of the source of data. This feature made it to the best  back  up with good speed of recovery of the data and  simplicity.However, because it  is needed for backing up  of  a lot of data, it is time consuming process,Besides it also  disturbs the routine application of  the technologist infrastructure. In addition large capacity storage is needed  for the  storage of  the large volume of back up with each new creation.

Incremental back up: back up work at high speed thus saves time, Little storage capacity is needed. This type of back up can be run as  many time as wished.

However, the restoration of data takes time, due to the time spent for restoration of initial back up and the incremental.

Differential Back up has very fast back up operation, because it only requires two pieces of back up.This is however slower compare to the Incremental.

The selective back up enable selection of certain type of file or folders for back up.

it can only be used to back up folders only when important data  are needed only.Thus the  storage capacity is low.

CPD eliminates back up window and reduces the recovery point objective.However, it has issue of compatibility with the resources to back up.,it is also expensive because its solutions are disk based.

Cloud based is affordable and save cost,It is easier to access. it is efficient,it can be access remotely for convenience.

However, Internet sources and some bandwidth must be available for access., always depends on third party providers,There is also problems encountered when switching providers.

Explanation:

In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Hill cipher where the Hill matrix can be any size from 2 x 2 up to 9 x 9. The program can be written using one of the following: C, C++, or Java. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below.Command Line Parameters1. Your program compile and run from the command line.2. The program executable must be named "hillcipher" (all lowercase, no spaces or file extension).3. Input the required file names as command line parameters. Your program may NOT prompt the user to enter the file names. The first parameter must be the name of the encryption key file, as described below. The second parameter must be the name of the file to be encrypted, as also described below. The sample run command near the end of this document contains an example of how the parameters will be entered.4. Your program should open the two files, echo the input to the screen, make the necessary calculations, and then output the ciphertext to the console (terminal) screen in the format described below.Note: If the plaintext file to be encrypted doesn't have the proper number of alphabetic characters, pad the last block as necessary with the letter 'X'. It is necessary for us to do this so we can know what outputs to expect for our test inputs.

Answers

Answer: Provided in the explanation section

Explanation:

C++ Code

#include<iostream>

#include<fstream>

#include<string>

using namespace std;

// read plain text from file

void readPlaneText(char *file,char *txt,int &size){

  ifstream inp;

 

  inp.open(file);

 

  // index initialize to 0 for first character

 

  int index=0;

  char ch;

 

  if(!inp.fail()){

      // read each character from file  

      while(!inp.eof()){

          inp.get(ch);

          txt[index++]=ch;

      }

  }

 

  // size of message

  size=index-1;

}

// read key

int **readKey(char *file,int **key,int &size){

  ifstream ink;

 

  //

  ink.open(file);

      if(!ink.fail()){

         

          // read first line as size

      ink>>size;

     

      // create 2 d arry

      key=new int*[size];

     

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

          key[i]=new int[size];

      }

     

      // read data in 2d matrix

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

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

              ink>>key[i][j];

          }  

      }

  }

  return key;

}

// print message

void printText(string txt,char *msg,int size){

  cout<<txt<<":\n\n";

 

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

      cout<<msg[i];

  }

}

// print key

void printKey(int **key,int size){

  cout<<"\n\nKey matrix:\n\n";

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

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

          cout<<key[i][j]<<" ";

      }  

      cout<<endl;

  }

}

void encrypt(char *txt,int size,int **key,int kSize,char *ctxt){

  int *data=new int[kSize];

 

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

 

  // read key size concecutive data

      for(int a=0;a<kSize;a++){

          data[a]=txt[i+a]-'a';

      }

     

      // cipher operation

      for(int a=0;a<kSize;a++){

          int total=0;

          for(int b=0;b<kSize;b++){

              total+=key[a][b]*data[b];

          }  

          total=total%26;

          ctxt[i+a]=(char)('a'+total);

      }      

  }

}

int main(int argc,char **argv){

  char text[10000];

  char ctext[10000];

  int **key;

  int keySize;

  int size;

  // input

  key=readKey(argv[1],key,keySize);

  readPlaneText(argv[2],text,size);

  encrypt(text,size,key,keySize,ctext);

 

  // output

  printKey(key,keySize);

  cout<<endl<<endl;

  printText("Plaintext",text,size);

  cout<<endl<<endl;

  printText("Ciphertext",ctext,size);

 

  return 0;

}

cheers i hope this helped !!!

The following if statement uses an overloaded > operator to determine whether the price of a Car object is more than $5000. Car is a struct and myCar is an object of Car. Each Cor object has two variables: id (int) and price (float). As you can see in the following code, the ID of myCar is 12345 and the price is $6,000. Car myCar - [12345, 6000.); float price - 5000; if (myCar > price) cout << "My car price is more than $5,000/n": Which one of the following function prototypes is correct syntax to overload the > operator based on the if statement above. void operator> float price: O bool operator>(Car & car, float price): bool operator (float amt): bool operator> Car & your Car): None of the above

Answers

Answer:

The correct syntax to overload is bool operator (float amt): so, the third statement is right.

Explanation:

Solution

From the given question we have to find which statements is correct for the following function prototype.

Now,

Since the price of a Car object is above  $5000, the car here is considered a struct and myCar is an object of Car

Both Car object consists of  two variables which are  id (int) and price (float)

Thus, from the given example the corresponding code says that the ID of myCar is represented as follows:

myCar - [12345, 6000);

The float price = 5000

Then,

cout << "My car price is more than $5,000/n"

Therefore the following statement bool operator (float amt): is the right syntax to overload.

When implementing a physical database from a logical data model, you must consider database performance by allowing data in the database to be accessed more rapidly. In order to increase data availability, the DBA may break up data that are accessed together to be stored together. Which method will improve the performance of this structure when running queries? What are advantages and disadvantages of this method?

Answers

Answer:

A method  used to improve the performance of structure when running queries is known as Partitioning indexes.

The advantages of partitioning indexes are, It enables data management operations for example,  index creation and rebuilding, It increases query performance.

The disadvantages are, one cannot define the primary index of partitioned table to be unique unless the whole partitioning column set is part of the primary index definition.

Explanation:

Solution

Partitioning indexes are known as b -tress indexes that shows hon how to break up the index into separate or different partitions.

Partitioning is usually done to enhance the performance and increased availability. when data are spread over  multiple partitions, one can be able to operate on one partition  without affecting others. i.e to run utilities, or to take data offline.

Almost all DBMS products support partitioning, but in various ways. we must be sure to know the nuances of an individual a particular DBMS execution before partitioning.

The advantages of Partitioned indexes are as follows:

It enables data management operations for example,  index creation and rebuilding

It increases  performance of query

It can significantly the impact of schedule downtime for maintenance operations

Disadvantages:

The primary index of partitioned table cannot be described to be unique except if  the whole partitioning column set is part of the primary index definition.

web pages with personal or biograpic information are called ​

Answers

Answer:

Web pages with personal or biographic information are called. a. Social Networking sites. c.

Explanation:

Other Questions
Stephan speaks in public on a regular basis and enjoys the experience with little to no anxiety but he is very anxious when asked to communicate in meetings. It seems that Stephan experiences ________ communication apprehension. . Act 20 g Ca (M = 40g / mol) with H2SO4 diluted within 10 seconds. What will be the rate of hydrogen formation in mol / sec. please Select the correct answerA historian publishes a paper on the ancient Greek leader Alexander the Great. However, most scholars reject his paper on the basis that theresearch is not reliable. Which factor could have led to this conclusion?The historian chose a subject that was unpopular among other scholars..The paper credited too many sources by renowned historians.Oc.The paper showed signs of bias and lacked proper citations.The historian taught history at a prestigious but small university.OD.OE. The historian regularly maintained personal historical blogs.ResetNext During digestion fat is broken down into The concentration determined for an unknown sample of hydrochloric acid by a student is 0.1354 M.According to the instructors information, the true molarity (M) of this solution is 0.1364 M. What is the percent error in this experiment? Round your answer to the nearest tenth. Why do you think why most of the doctors settle in urban area? The 102nd floor of the sears tower in Chicago is the highest occupied floor. It is 1,431 feet above the ground . How many yards above the ground is the 102nd floor The adjusted trial balance for Yondel Company at December 31, 2018 is presented below: Accounts Debit Credit Cash $ 8,000 Prepaid rent 23,000 Land 445,000 Accounts payable $ 12,000 Salaries payable 20,000 Common stock 230,000 Retained earnings 109,000 Dividends 14,000 Service revenue 340,000 Salaries expense 160,000 Rent expense 29,000 Utilities expense 32,000 Totals $ 711,000 $ 711,000 Prepare the closing entries for Yondel Company for the year ended December 31, 2018. What is the solution to the equation? 5=2/5a Please answer this correctly In weight training, "listen to your body" means to stop lifting if you feel bored or unmotivated. the name of Africas longest river is the If a case of chips has 27 bags in it. How many cases would they need for 410 bags of chips?Equation: What can you conclude about the daughters, based on the passage? Check all that apply.They struggle to fit in.They feel supported by their mother.They value their mothers advice.They embrace American culture.They want to leave New York. The U.S. continues to become more dependent on the global domain within the information environment consisting of the interdependent network of information technology infrastructures, including the Internet, telecommunications networks, computer systems, and embedded processors and controllers. It is imperative that we safeguard this domain known as _____. As part of an insurance companys training program, participants learn how to conduct an analysis of clients insurability. The goal is to have participants achieve a time in the range of 30 to 47 minutes. Test results for three participants were: Armand, a mean of 37.0 minutes and a standard deviation of 3.0 minutes; Jerry, a mean of 38.0 minutes and a standard deviation of 2.0 minutes; and Melissa, a mean of 38.5 minutes and a standard deviation of 2.9 minutes.a.Which of the participants would you judge to be capable? (Do not round intermediate calculations. Round your answers to 2 decimal places.)Participants :Armand: Cpk _____ Cp Capable ? No/YesJerry: Cpk _____ Capable ? Yes/No Melissa Cp ________ No/Yesb.Can the value of the Cpk exceed the value of Cp for a given participant?yes or no g For a period during which the quantity of inventory at the end was smaller than that at the beginning, income from operations reported under variable costing will be smaller than income from operations reported under absorption costing. Group of answer choices False True PLEASE HELP WILL MARK BRAINLIEST Bede's Historia Ecclesiastica describes the change from a barbaric society to a civilized culture.True False Can someone please help me with this I need help finding x and y using special right triangles and if you could please explain how