Here are the steps. (1) Create a Student class containing an ID, a last name, and a list of course names such as "COP2210" or "COP2250". This should not be a string of multiple courses. The ID should be an integer which is printed with leading zeros. (2) Create a class named StudentTest that contains a List of students. Do not use the list provided here. In the class constructor, create 15 students and add them to the list. Each student's ID must be different. Each student you add to the list must contain 2-4 different course names. At least one should have two course names and at least one should have four course names. Make sure the students do not all have the same courses, although there should be some overlap (see the sample below). The student names must be inserted into the list in random order (not sorted). (3) Sort the list in ascending order by student last name and display the list. For each student, display the ID with leading zeros, last name, and list of courses on a single line. Here is sample output. Note how the tab character is inserted after the name to line up the next column containing courses. Be sure there is no trailing comma at the end of the list of courses.

Answers

Answer 1

Answer:

Java code is given below with appropriate comments

Explanation:

import java.util.*;

public class Student

{

String ID, lastName;

//Arraylist to store courses

ArrayList courses = new ArrayList();

public Student()

{

//Default constructor

ID = "";

lastName = "";

}

public Student(String I, String l)

{

//Parameterized Constructor to initialize

ID = I;

lastName = l;

int i, n;

String temp;

Scanner sc = new Scanner(System.in);

System.out.print("\nHow many courses you want to add: ");

n = Integer.parseInt(sc.nextLine());

if(n < 3){ //Cannot choose less than 3 courses

System.out.println("\nNumber of courses must be at least 3.");

return;

}

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

{

System.out.print("\nEnter course name: ");

temp = sc.nextLine();

if(courses.contains(temp))//If course already present

{

System.out.println("\nCourse already present. Try another.");

i--;

}

else

{

courses.add(temp); //Adding course

}

}

}

//Accessors

public String getID()

{

return ID;

}

public String getName()

{

return lastName;

}

public ArrayList getCourses()

{

return courses;

}

//Mutators

public void setID(String i)

{

ID = i;

}

public void setName(String n)

{

lastName = n;

}

public void setCourses(ArrayList c)

{

courses.clear();

courses.addAll(c);

}

}

class StudentTest

{

//To store 10 students

Student[] list = new Student[10];

public StudentTest(){

int i, j, flag;

Scanner sc = new Scanner(System.in);

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

{

String temp, l;

System.out.print("\nEnter student ID: ");

temp = sc.nextLine();

flag = 1;

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

{

if(list[j].getID().equals(temp))//If ID already exists

{

System.out.println("\nID already exists. Try another.");

flag = 0;

i--;

break;

}

}

if(flag == 1)

{

System.out.print("\nEnter student Last name: ");

l = sc.nextLine();

list[i] = new Student(temp, l); //Initializing student

}

}

}

public void sort()

{

//To sort and display

int i, j;

String temp;

ArrayList t = new ArrayList();

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

{

for(j = 0; j < 9 - i; j++)

{

if(list[j].getName().compareTo(list[j + 1].getName()) > 0)//If list[j + 1].lastName needs to come before list[j].lastName

{

//Swapping IDs

temp = list[j].getID();

list[j].setID(list[j + 1].getID());

list[j + 1].setID(temp);

//Swapping last names

temp = list[j].getName();

list[j].setName(list[j + 1].getName());

list[j + 1].setName(temp);

//Swapping courses

t.clear();

t.addAll(list[j].getCourses());

list[j].setCourses(list[j + 1].getCourses());

list[j + 1].setCourses(t);

}

}

}

//Display

System.out.println();

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

{

System.out.print(list[i].getID() + ", " + list[i].getName());

//Using fencepost loop to print with comma before

System.out.print(" " + list[i].getCourses().get(0));

for(j = 1; j < list[i].getCourses().size(); j++)

System.out.print(", " + list[i].getCourses().get(j));

System.out.println();

}

}

public static void main(String args[])

{

StudentTest S = new StudentTest();

S.sort();

}

}


Related Questions

Write a program having a concrete subclass that inherits three abstract methods from a superclass. Provide the following three implementations in the subclass corresponding to the abstract methods in the superclass:

1. Check for uppercase characters in a string, and return true or false' depending on if any are found.
2. Convert all of the lower case characters to uppercase in the input string, and return the result.
3. Convert the input string to integer and add 10, output the result to the console.
Create an appropriate class having a main method to test the above setup.

Answers

Answer:

C++

Explanation:

using namespace std;

class AbstractClass {

public:  

   virtual bool checkUpperCase(string inputString);

   virtual string lowerToUppercase(string inputString);

   virtual void stringToInt(string inputString);

};

class ConcreteClass: public AbstractClass {

public:

   bool checkUpperCase(string inputString) {

       bool isUpper = false;

       for (int i=0; i < strlen(inputString);  i++) {

           if (isupper(inputString[i])) {

               isUpper = true;

               break;

           }

       return isUpper;

      }

   string lowerToUppercase(string inputString) {

       for (int i=0; i < strlen(inputString);  i++) {

           putchar(toupper(inputString[i]));

       }

       return inputString;

   }

   void stringToInt(string inputString) {

       int convertedInteger = stoi(inputString);

       convertedInteger+=10;

       cout<<convertedInteger<<endl;

   }

};

int main() {

   ConcreteClass cc;

   return 0;

}

If a device is determined to have an out-of-date virus signature file, then Network Access Control (NAC) can redirect that device to a network by __________.

a. a Trojan horse
b. TCP/IP hijacking
c. Address Resolution Protocol (ARP) poisioning
d. DHCP man-in-the-middle

Answers

Answer:

C. Address Resolution Protocol (ARP) poisoning.

Explanation:

An antivirus signature file is a program written to describe and remedy a group of identified malware attacks, to prevent future attacks from the described malicious softwares. It is constantly updated to identify more malicious softwares.

A network access protocol (NAC) is used to implement access control on a network, collaborating with other protocols like ARP and unifying antiviruses, intrusion detection and vulnerability assessment.

When the virus signature file is out of date, the NAC allows a new malware, the antivirus can not identify, to access the network through ARP poisoning.

Cisco has created a proprietary layer 2 protocol used to manage VLAN configuration between switches called:________a. VLAN Configuration Protocolb. VLAN Tracking Protocolc. VLAN Creation Protocold. Auto VLAN Configuration Protocole. None of the above

Answers

Answer:

The correct answer is letter "E": None of the above.

Explanation:

The VLAN Trunking Protocol (VTP) provides an easy way of keeping an accurate VLAN configuration through a commuted network. The VTP allows solutions of commuted network easily scalable to other dimensions, reducing the need of manually setting up the red. The VTP composed of a layer 2 protocol used to manage VLAN setups between switches.

What happens when you position the mouse cursor over an edge or corner of a bounding box that has sizing handles?

Answers

Answer:

The cursor changes to a two edged arrow pointer and the bounding box is highlighted.

Explanation:

Bounding boxes in windows operating system is a boundary line of the windows box that run that runs applications and other utilities in the system. A sizing handle is a tool used in place of a the minimize and maximize button on top of the windows box. It is found on the bottom right edge of the windows box.

When a cursor points to the sizing handle, the cursor changes to a double edge arrow pointer and the bounding box is highlighted, and can be resized on the screen.

Answer:

The correct answer is: the cursor changes to a two edged arrow pointer.

Explanation:

Sizing handles allow users to resize objects -typically windows- at will by placing the cursor over one of the corners of the object. A double edge arrow will replace the cursor. The user will have to left-click the mouse and drag the sizing handle to modify the size of the object. After letting the left click go and moving the mouse around, the cursor appears again with its regular features.

"to store and manage the databases of the client/server system, each server requires what"

Answers

Answer:

A Data Base Management System (DBMS)

Explanation:

Databases refer to organized data collection mostly stored and accessed by computers and other electronic systems/devices. In other to effectively store, retrieve, manipulate/change data items in a database, a software package called a Data Base Management System (DBMS) is required. This software allows the manipulation, retrieval and general management of the data in the database. popular examples of DBMS are MySQL and Microsoft SQL Server. Therefore in a client/server system as stated in the this question, each server will require a DBMS installed to allow interaction with users and other applications, in order to capture, store, and manage data.

Jeffery wants to locate reliable academic information on the effects of global warming and ways to conserve energy. What is the most efficient and effective search strategy to identify subject terms for a database search?a. He can look for common related subject terms in a dictionary, thesaurus or encyclopedia.b. He can look for relevant articles in the results list from a database search and scan the subject terms.c. He can use Google Scholar to retrieve relevant articles and find common related subject terms.

Answers

Answer:

c. He can use Google Scholar to retrieve relevant articles and find common related subject terms.

Explanation:

Of the options provided, the third is the most effective and efficient search strategy. Google Scholar is a deep level tool that can be used to search for relevant academic information from published academic tests. It has very useful search options and it will be very effective and efficient in this instance.

Technological uncertainty:

a. is a result of uncertainty about customer demand.
b. occurs because an alternative technology could be introduced by competitors.
c. only occurs in emerging markets.
d. can be avoided by early entrants with superior technology.

Answers

Answer:

The correct answer is: "b. occurs because an alternative technology could be introduced by competitors".

Explanation:

It is very difficult to assess how technological uncertainty has been developed and maintained throughout the years, although it is possible to state that it may occurs when other alternative technologies are developed and launched, besides other factors. Technology companies and agencies are interested in developing their products as best as possible, therefore, competition increases with marketability and produces uncertainty among all developers, software and hardware engineers, and other Information Technology (IT) workers who are responsible for creating new technological tools which may solve the problem of uncertainty among them all and improve society.

(ps: mark as brainliest, please?!)

Choose one of the hacks discussed by Mr. Holman in the video, and using your favorite search engine conduct some additional research on the hack. What is the vulnerability being exploited?

Answers

Answer:

When hacks are discussed with Mr. Holman on video than their vulnerability being exploited

Explanation:

When hacks have given suggestions to  Mr. Holman in his video on favorite search engine there is hundred percent vulnerability is there. Better to avoid the suggestion and make sure not to use the link or any software is been installed. Once end-user click on software or link his or her computer or laptop or PC is hacked and his or her data is exposed to hackers. Once the data is hackers there is steal on data such as video or pictures are exposed and hackers can misuse.

Final answer:

Hackers exploit vulnerabilities using tactics like phishing, malware, and social engineering to steal sensitive data. The stolen data is used for financial gain or identity theft. Reducing hacking requires updates, security measures, and user education.

Explanation:

When evaluating the techniques that hackers use to compromise systems, one common method is by exploiting various vulnerabilities. Hackers might target vulnerabilities within software, such as outdated systems, unpatched flaws, or configuration errors.

They deploy tactics such as phishing, malware, and social engineering to trick users into giving up sensitive information or to gain unauthorized access to systems.

Among the reasons hackers engage in these activities are to steal personal data, financial information, or intellectual property. The stolen data can be used for financial gain, identity theft, or even to gain a competitive advantage.

Hackers are often quite successful due to the sophistication of their tactics and the general lack of awareness and preparedness among users. To reduce or stop hacking, it is essential to consistently update systems, implement security measures like firewalls and antiviruses, and educate users on best practices for cyber hygiene.

A data _____ is a collection of data from a variety of sources used to support decision-making applications and generate business intelligence

Answers

Answer:

warehouse

Explanation:

A bit similar to a database, a data warehouse is a collection or large store of data from different sources that businesses and organization can use to make intelligent business decisions. The data sources for a data warehouse are typically databases from different vendors and architectures.

Data warehouses are typically data repositories used by organizations for data analysis and reporting purposes.

Final answer:

A data warehouse is a centralized repository that aggregates data from multiple sources to support decision-making applications and generate business intelligence. Evaluating the credibility of these sources and utilizing information technology can greatly enhance the quality and usability of the data.

Explanation:

The blank in the question should be filled with the term data warehouse. A data warehouse is a centralized repository that stores data from multiple sources. This data is often gathered from sources that record, analyze, and interpret primary data, which is critical for generating valuable business intelligence. It's essential to evaluate the credibility of these sources to ensure the data's accuracy and reliability.

Data becomes valuable information once it's put into context, analyzed to answer questions, or used within analytical frameworks. Information technology, particularly computers, greatly facilitates this transformation by automating repetitive tasks, managing data storage efficiently, and providing various tools for data analysis.

Sources of data can be incredibly diverse, ranging from satellites and grocery store scanners to traffic sensors and smartphone apps. These capabilities help businesses and organizations in making strategic decisions and forecasting future trends.

What do you call the process of translating statements written by a developer? What is the result of this process?

Answers

Answer:

The translator is the software that is called to translate the statement written by the developer and the result of the process is machine code which can be understood by the computer system.

Explanation:

A translator is a software or processor which is responsible to convert the code into machine-executable language or machine code or binary language. This language is made up of 0 and 1.There are so many translators which are specific for any particular language. For example assembler and compiler.The above question wants to ask about the process which is used for translating a statement written by a developer which is a translator and the result of this process is machine code which is understood by the computer system.

If you reformat the hard drive on a computer, it erases all personal information from your computer and makes it safe to donate. True False

Answers

The answer would be false

Universal Containers is setting up an external Business Intelligence (BI) system and wants to extract 1,000,000 Contact records. What should be recommended to avoid timeouts during the export process?A. using the soap API to export dataB. utilise the bulk API to export the dataC. use GZIP compression to export the data

Answers

Answer:

C. use GZIP compression to export the data

Explanation:

GZIP compression is used to improve transfer speed trough network.

GZIP compression enables smaller file sizes, which leads extracting faster.

GZIP compression is also used for server-side webpages, so that the webpage is uploaded faster.

Once data is compressed with GZIP, it is decompressed by the same application after transmission.

An easy way to validate configuration is to use an Oracle version of the TCP/IP ping utility, called

Answers

Answer:

TNSPING

Explanation:

tnsping is a utility, this helps us to determine the service on an Oracle Net network can be reached successfully.

If you want to connect between a client and server, we can use the tnsping utility, in this case, we're going to receive an estimated time around the trip in milliseconds it takes to reach the Oracle service, if it fails, we're going to receive an error message.

You are tasked with creating a mileage calculator to calculate the amount of money that should be paid to employees. The mileage is computed as follows An amount of .25 for each mile up to 100 miles An amount of .15 for every mile above 100. So 115 miles would be (.25 * 100) + (.15 * 15) This can all be coded using a mathematical solution but I want you to use an if / else statement. Here is how you are to implement it: If the total miles input is less than or equal to 100 then simply calculate the miles * .25 and output the amount otherwise compute the total amount for all miles mathematically. Input: Total number of miles Process: dollar amount owed for miles driven Output: Amount of money due * Please note that you should simply do calculations within the if and else statements. This mean no cin or cout within if or else. Do it afterward.

Answers

Answer:

Desired C++ Program with proper comment is given below

Explanation:

#include<iostream>

using namespace std;

//main function

int main()

{

  int totalMiles = 0;

  int remainingMiles = 0;

  double amt = 0;

 

  //taking input from user regarind total miles

  cout<<"Enter the total miles: "<<endl;

  cin>>totalMiles;

  //if-else condition to do the calculation

  if(totalMiles<=100)

  {

      amt = totalMiles*.25;

  }

  else

  {

      remainingMiles = totalMiles - 100;

      amt = 100*.25 + remainingMiles*.15;      

  }

 

  cout<<"The total amount is: "<<amt<<endl;

}

A website updated daily could be considered _____. a. authoritative b. objective c. accurate d. timely

Answers

Answer:

option C: accurate

Explanation:

this is because daily updated website contains the up to date information.

You are working as a Software Programmer for one of the big retail company. You need to implement the program that can store at least 15 customer information using the Array concept. You need to implement the individual array to store each of below field. CustomerName CustomerAddress1 City State Zip Once the data is stored in the array, then you need to loop thru the entire zip loop and print all the zip code on the command line.

Answers

Answer:

The C++ code is given below with appropriate comments. Random names of customer information are chosen as samples

Explanation:

#include <iostream>

using namespace std;

int main()

{

// Initialize String Arrays for customerName,customerAddress1,city,state,zip for 15 customers

string customerName[15] = {"Liam","Noah","William","James","Logan","Benj","Mason","Elijah","John","Patty","Cheryl","Nick","Brian","Steve","mark"};

string customerAddress1[15] = {"Liam - Address1","Noah - Address2","William - Address3","James - Address4","Logan - Address5","Benjamin - Address6","Mason - Address7","Elijah - Address8","John - Address9","Patty - Address10","Cheryl - Address11","Nick - Address12","Brian - Address13","Steve - Address14","mark - Address15"};

string city[15] = {"Sitka","Juneau","Wrangell","Anchorage","Jacksonville","Anaconda","Oklahoma City","Fort Worth","Dallas","Sitka","Juneau","Wrangell","Anchorage","Jacksonville","Anaconda"};

string state[15] = {"Alaska","Alaska","Alaska","Alaska","Florida","Montana","Montana","Oklahoma","Texas","Arizona","Tennessee","California","Virginia","Indiana","Virginia"};

int zip[15] = {30041,36602,75062,78952,12071,55874,11236,44512,55262,99874,11020,55820,11304,11587,11047};

// Print Zips for the customers

cout <<"Customer Names"<<"\t"<< "Zip Code"<< "\n";

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

cout <<customerName[i]<<"\t\t\t"<< zip[i] << "\n";

}

Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
1. SaaS2. IaaS3. PaaS4. MaaS

Answers

Answer:

1. SaaS

Explanation:

Cloud computing is a platform that provides online server services for an individual or a group of clients. The cloud computing services are of four types, namely, SaaS (software as a service), IaaS (infrastructure as a service), PaaS (platform as a service) and MaaS (mobility as a service).

The SaaS is used by web or email services, where the server sends or loads the application data to the client, and all data can be viewed and modified on the copy of the data sent to the client.

Write a statement that assigns finalResult with firstSample plus secondSample, divided by 3. Ex: If firstSample is 18 and secondSample is 12, finalResult is 10.

Answers

Answer:

finalResult=(firstSample+secondSample)/3;  //coded inc++

Explanation:

The above code is executed in c++. As it involves basic arithmetic, so, if whole program has to be written,then they can be declared of type int,float or double as required and then the above statement must be used in which firstSample and secondSample has been added first and the result is divided by 3 to obtain the desired output.

Write a program that calculates the occupancy rate for each floor of a hotel. The program should start by asking for the number of floors the hotel has. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor, and how many of them are occupied. After all the iterations, the program should display the number of rooms the hotel has, the number that are occupied, the number that are vacant, and the occupancy rate for the hotel. Input Validation: Do not accept a value less than 1 for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor.

Answers

Answer:

# User is prompted to enter the number of floor in hotel

# The received value is assigned to no_of_floor

no_of_floor = int(input("Enter the number of floor in the hotel."))

# This loop is to enforce that user input is not less than 1

while (no_of_floor < 1):

   no_of_floor = int(input("Enter the number of floor in the hotel."))

# counter variable is initialized to loop through the no_of_floor

counter = 1

# total number of rooms occupied in the hotel is initialized to 0

total_occupied = 0

# total number of rooms vacant in the hotel is initialized to 0

total_vacant = 0

# total number of rooms in the hotel is initialized to 0

total_room = 0

# loop through each floor

while counter <= no_of_floor:

   # number of room in a floor is received from user

   number_of_room = int(input("Enter the number of room in floor: "))

   # this loop ensure that the number must not be less than 10

   while (number_of_room < 10):

       number_of_room = int(input("Enter the number of room in floor "))

   # number of occupied room is a floor is accepted from user

   number_of_occupied = int(input("Enter the number of occupied room."))

   # this loop ensure that the no_of_occupied is less than no_of_room

   while (number_of_occupied > number_of_room):    

       number_of_occupied = int(input("Enter the number of occupied room."))

   

   # number of vacant room in a floor is calculated

   floor_vacant = number_of_room - number_of_occupied

   # total number of occupied room is calculated

   total_occupied += number_of_occupied

   # total room in the hotel is calculated

   total_room += number_of_room

   # total number of vacant room is calculated

   total_vacant += floor_vacant

   # the counter is increment to move to the next floor

   counter += 1

# occupancy_rate is calculated as a percentage

occupancy_rate = (total_occupied / total_room) * 100

# Number of total room is displayed

print("The total number of room in the hotel is: ", total_room)    

# Number of total vacant room is displayed

print("The number of vacant room in the hotel is: ", total_vacant)

# Number of total occupied room is displayed

print("The total number of occupied room in the hotel is: ", total_occupied)

# The occupancy rate for the hotel is displayed to 2 decimal

#  place percent

print("The occupancy rate for the hotel is: {:.2f}%".format(occupancy_rate))

Explanation:

The program is well commented. It put all the constraint into consideration like:

not allowing a user to enter less than 1 for number of floorsnot allowing a user to enter less than 10 for number of rooms in a floornot allowing a user to enter number of occupied room greater than number of room in a floor.

The key to providing controlled variability in algorithms is to employ one or more placeholders, called Select one a. methods b. numbers c. parameters d. polynomials e. functions

Answers

Answer:

c. parameters

Explanation:

Parameters are simply placeholders (sometimes called dummy variables) used mainly by methods to perform their given tasks so as to provide controlled variability in  the program(or algorithm). Sometimes they are called arguments. But then it is much more specific to simply use parameters rather than arguments because arguments are the variable values that the parameters are serving as placeholders for.

Parameters identify and describe values that are passed into a function or subroutine.

Parameters are also used for simulation and testing purposes where the input s to the program are or can be varied.

PS: Methods are just functions performed by a class in a program.

How do you move on to another question after you select Grade It Now and read the explanation?

Answers

Answer:

After you select Grade It Now and read the explanation, just click the Grade It Now or Save and Continue button after you’ve answered each question to move on to another question.

Explanation:

Welcome to Aplia different type of questions:

- True or False answers: Not able to redo practice problems after deadline.

- Graded at Deadline problems: Not be able to try a problem again after it is graded.

- Grade It Now problems: you can Save your work and come back to it later, by clicking Save and Continue, you can attempt each problem 3 times.

After clicking the Grade It Now button, you can click on any of the blue bars labeled “Explanation” to see the correct answer.

- Scroll down questions to check all that apply: by clicking the down arrow, pressing the backspace key on the keyboard; using your mouse to drag the scroll bar.

- Fill in blanks questions: completing sentences or entering values into a table.

- Radio button questions and blanks: only one correct answer.

- Checkbox questions: multiple correct statements.

You’ll need to implement a method called String getWinner(String user, String computer) that determines whether the user or computer won the game, and return the correct winner!

Answers

Answer:

The solution code is written in Java.

String getWinner(String user, String computer) {        if(status == x) {            return user;        }        else {            return computer;        }    } String winner = getWinner("User_X", "Comp_X");

Explanation:

A method getWinner() that take two parameters, user and computer, is written (Line 1 - 8). This method presumes that there is a global variable, status. This status variable holds the value that will decide if method should return either user or computer name as winner (Line 3, 5).

Line 10 shows a statement that implement the getWinner() method.

A _____________ is a method of controlled entry into a facility and provides access to secure areas such as a research lab or data center

Answers

Answer:

The correct answer to the following question will be "Mantrap".

Explanation:

A Mantrap, an airlock, or an authentication vestibule is a data security network management mechanism composed of a confined space of two sets of interlinking doors, so the first collection of doors should be locked until the second period decides to open.It is a network management machine designed and limited to a finite space that would be segregated by two gates from adjoining rooms, usually an extraction point and an entrance door that could not be activated at almost the same period.

Therefore, Mantrap is the right answer.

-Which of the following is true about Web services?
A - Web services are open standard XML, SOAP, HTTPetc. based Web applications.
B - Web services interact with other web applications for the purpose of exchanging data.
C - Web Services can convert your existing applications into Web-applications.
D - All of the above

Answers

Answer:

The answer is "Option D".

Explanation:

Web service is also known as an online open software product, which uses a common XML messaging service system. It is used service like HTTP, SOAP, etc, that encrypts messages from all web services.

It uses the internet, that enables you the interface or application for the user interaction or exchanging data. It will turn the software into web apps.

Object Oriented Programming (OOP) allows us to handle complex code in an organized structure and break down the problem by modelling it in a way that relates to our everyday life. With fast advancement in technology and ever decreasing product cycles, many developers are starting to believe that OOP is not currently being implemented as it was intended to be implemented. They believe that OOP is unnecessarily complicating the problem solving so, OOP should be phased out as the absence of structure is better (in many cases) than having bad structure.

Analyze the above statement very carefully and answer the following:

• Do you believe that OOP should be phased out and we should start working on some alternative(s)? Provide your answer with Yes or No.

• Give your opinion with two solid reasons to support your answer.

Answer just 4 to 5 lines

Answers

No I don't believe that OOP should be phased out.

Explanation:

Reason:

OOPS make things simpleIt promotes inheritance to avoid repetition, abstraction and encapsulation of keeping data secured and wonderful concept of object.OOP is kept as the base for many of the Application development software like Dot Net, Java, etc.The world is running around by objects and and OOP concept is the best possible method to handle those.OOP is an time-tested method and it should not be phased out.

In a dictionary whose keys are the warehouses: associated with each warehouse is an inner dictionary whose keys are the stocked products (and whose associated values are the inventory of that product in the warehouse). The inventory must always be a non-negative value; an inventory of 0 is legal. For example, a simple/small database might be.

db = {'Irvine' : {'brush': 3, 'comb': 2, 'wallet': 2}, 'Newport': {'comb': 7, 'stapler': 0},
'Tustin' : {'keychain': 3, 'pencil': 4, 'wallet': 3}}

This data structure means that

The Irvine warehouse stocks 3 brushes, 2 combs, and 2 wallets.

The Newport warehouse stocks 7 combs, and 0 staplers.

The Tustin warehouse stocks 3 keychains, 4 pencils, and 3 wallets.

(c) The by_store_inventory2 function returns a list of 2-tuples (str,int) (warehouse names and inventory), sorted ascending by which warehouses have the largest inventory (summed over all the products). If two warehouses store the same inventory, they should appear in ascending order of warehouse name: for the db dictionary above the result is [('Irvine', 7), ('Newport', 7), ('Tustin', 10)].

Answers

Answer:

Here is the completed code for this problem. Comments are included, go through it, learn how things work.

Note: Please maintain proper code spacing (indentation), just copy the code part and paste it in your compiler/IDE directly, no modifications required.

Explanation:

#code

#required method taking a db as parameter

def by_product_inventory_count(db):

   #one line statement, which initially creates a list of all keys (warehouse names)

   #from the dict using a list comprehension, then sorts it by length of the inner dict

   #represented by each warehouse name, and if the length is same, sorts by key itself

   #(alphabetically), and returns this sorted list

   return sorted([key for key in db],key=lambda x:(len(db[x]),x))

#creating a db and testing the method

db={'Irvine' : {'brush': 3, 'comb': 2, 'wallet': 2}, 'Newport': {'comb': 7, 'stapler': 0},

'Tustin' : {'keychain': 3, 'pencil': 4, 'wallet': 3}}

sorted_warehouse_names=by_product_inventory_count(db)

print(sorted_warehouse_names)

#OUTPUT

['Newport', 'Irvine', 'Tustin']

A(n) ________ is information that is passed to a function, and a(n) ________ is information that is received by a function.

a. function call,
b. function header parameter,
c. argument argument,
d. parameter prototype,
e. header
f. None of these

Answers

Answer:

i looked it up and the answer i got would be D

Explanation: hope this helps!

Find the word-length 2's complement representation of each of the following decimal numbers:a. 845b. 15000c. 100d. -923

Answers

Answer:

(a) 845 = 0000 0011 0100 1101

(b) 1500 = 0011 1010 1001 1000

(c) 100 = 0000 0000 0110 0100

(d) -923 = 1111 1100 0110 0101

Explanation:

NOTES:

First Note: The question requests that the numbers be represented in word-length. That means they should be represented in 16bits (a word is 2 bytes).

Second Note: To convert a number to its 2's complement representation,

(i) if the number is positive, the usual conversion to binary will suffice. You might just need to add zero at the beginning of the sequence of bits to ensure that the leftmost bit is a zero(0).

(ii) if the number is negative, then;

=> convert the magnitude of the number to its binary

=> add zeros to the beginning of the sequence of binary until the sequence has the specified length

=> flip each bit in the sequence and add 1 to the result.

SOLUTION:

Applying the rules in the notes above, lets convert the numbers.

(a) 845 => The number is positive, conversion to its binary will suffice

2  |  845

2  |  422 R 1

2  |  211 R 0

2  |  105 R 1

2  |  52 R 1

2  |  26 R 0

2  |  13 R 0

2  |  6 R 1

2  |  3 R 0

2  |  1 R 1

2  |  0 R 1

Writing the remainders upwards, we have

845 = 1101001101

Pad with zeros to convert it to its word-length representation.

845 = 0000 0011 0100 1101

(b) 15000 => The number is also positive, so following the same step as above,

15000 = 11101010011000

Pad with zeros to convert it to its word-length representation.

15000 = 0011 1010 1001 1000

(c) 100 => The number is also positive, so following the same step as above,

100 = 1100100

Pad with zeros to convert it to its word-length representation.

100 =  0000 0000 0110 0100

(d) -923 => The number is negative;

-->  first convert its magnitude (923) to binary

923 = 1110011011

--> Pad with zeros to convert it to its word-length representation.

923 =  0000 0011 1001 1011

--> Flip the bits

0000 0011 1001 1011 = 1111 1100 0110 0100

--> Add 1 to the result above

1111 1100 0110 0100 + 1 = 1111 1100 0110 0101

Therefore;

-923 = 1111 1100 0110 0101

The word length 2's complement representations are:

a. 845: 001101001101

b. 15000: 0011101101100000

c. 100: 0000000001100100

d. -923: 1111110001000101

We have,

To find the word-length 2's complement representation of each decimal number, we first need to determine the binary representation of the absolute value of the number and then convert it into its 2's complement form if the number is negative.

Assuming the word length is 16 bits:

a. 845:

Binary representation of 845: 0011 0100 1101

Since it is positive, the 16-bit 2's complement representation remains the same: 0011 0100 1101

b. 15000:

Binary representation of 15000: 0011 1011 0110 0000

Since it is positive, the 16-bit 2's complement representation remains the same: 0011 1011 0110 0000

c. 100:

Binary representation of 100: 0000 0000 0110 0100

Since it is positive, the 16-bit 2's complement representation remains the same: 0000 0000 0110 0100

d. -923:

Binary representation of 923: 0000 0011 1011 1011

To find the 16-bit 2's complement representation, we first invert all the bits: 1111 1100 0100 0100

Then, add 1 to the inverted value: 1111 1100 0100 0101

So, the 16-bit 2's complement representation of -923 is: 1111 1100 0100 0101

Thus,

a. 845: 001101001101

b. 15000: 0011101101100000

c. 100: 0000000001100100

d. -923: 1111110001000101

Learn more about complements representations here:

https://brainly.com/question/33566495

#SPJ3

Write a while loop that prints

A. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.

B. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90

C. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.

Answers

Answer:

# include <iostream>

#inlcude<conio.h>

using namespace std;

main()

{

int n,x;

cout<<"Enter Value of n"

cin>>n;

x=0;

while (x<n)

{

cout<< "Square of Value "<<x^2;

if (x%10==0)

{

cout <<x;

}

cout<<"2^"<<x<<"="<< 2^x;

x++;

}

getch();

}

The git _____ command will display the last commit and what were the changes you made.

Answers

Answer:

Log

Explanation:

The git log command enables you to display a list of all of the commits on your current branch

Other Questions
According to the text, young boys learn "the boy code" from parents, siblings, peers, and teachers, which encourages all of the following EXCEPT: When a nonvolatile solute is added to a volatile solvent, the solution vapor pressure __________, the boiling point __________, the freezing point __________, and the osmotic pressure across a semipermeable membrane __________. Group of answer choices According to the information in Encyclopedia Britannica (2015) on fossil records, which of the following was the least severe of the five major extinctions of life on earth? "When asked to identify what is most important to their happiness, an overwhelming majority of people typically rated ____ at the top of their list." Romex is considered to be supported when it passes through bored or punched holes in framing members that are no more than______apart. a. Britton String Corp. manufactures specialty strings for musical instruments and tennis racquets. Its most recent sales were $880 million; operating costs (excluding depreciation) were equal to 85% of sales; net fixed assets were $300 million; depreciation amounted to 10% of net fixed assets; interest expenses were $22 million; the state-plus-federal corporate tax rate was 25%; and it paid 40% of its net income out in dividends. Given this information, construct its income statement. Also calculate total dividends and the addition to retained earnings. Report all dollar figures in millions. Which equation represents the line that passes through points (0,6) and (2,0)? A) y= -1/3x + 2 B) y= -1/3x + 6 C) y= -3x +2 D) y= -3x + 6 ( yes, im that dumb, sorry ) 1025267923Calculate the mean,median and mode of thefollowing set of numbers. 1A soccer ball is kicked horizontally off a 22.0-meter high hill and lands a distance of 35.0 meters from the edge of the hill. Determine the initial horizontal velocity of the soccer ball. A __________ person is one who has moral integrity and has a strict regard for doing what is considered the right thing to do. _____ refers to what sets an organization apart from others and provides it with a distinctive edge for meeting customer or client needs in the marketplace. a. Due diligence b. Organizational culture c. Competitive advantage jacques louis david was an extremely influential artist in his time because he was Martha is not receptive to new ideas and is unwilling to share ideas with her co-workers. This scenario best illustrates a lack of the _____ element of trust. A categorical variable whose values are purely qualitative and unordered is called a _______ variable. Please type the correct answer in the following input field, and then select the submit answer button or press the enter key when finished. Your answer: How do elements from Earth's interior get into seawater? An elderly client with diabetes comes to the clinic in winter reporting numbness of the feet what is the nurse action if the feet are ice cold to the touch and appear waxy and pale which of the following values for x and y satisfy the following system of the equations? { x + 4y = 10 {5x + 10y = 20a. x = 3, y = 2b. x = 2, y - 3c. x = -2, y = 3d. x = 3, y = -2 what's the best way to start a career in either photography or animal care? The ease with which the charge distribution in a molecule can be distorted by an external electrical field is called the __________.A) electronegativityB) hydrogen bondingC) polarizabilityD) volatilityE) viscosity A number is picked randomly in the range [2,8]. If past selection indicates that the numbers picked are less than 5, what is the probability that a number picked will be (a) less than 4 (b) greater than 4. What is the probability that the number picked is 4.5 Steam Workshop Downloader