Answer:
Third Generation Computers
Explanation:
Third-generation languages use symbols and commands to help programmers tell the computer what to do.
Third-generation language. Also known as a "3GL," it refers to a high-level programming language such as FORTRAN, COBOL, BASIC, Pascal, and C. It is a step above assembly language and a step below a fourth-generation language (4GL).
Which of the following instructions should be allowed only in kernel mode? (a) Disable all interrupts. (b) Read the time-of-day clock. (c) Set the time-of-day clock. (d) Change the memory map.
Answer:
A, B and D
Explanation:
The kernel is the central core of the computer's operating system, that has total control of all the activities of the computer. The kernel is a very small program in memory and runs first during the boot of the system. It is the interactive link between the hardware and operating system and other system softwares.
The uses a command line to receive and execute command for various system configurations like storage and memory mapping, enable and disable interrupts, set timers or allocate time slice to run programs etc.
rrayList Mystery Consider the following method:
public static void mystery(ArrayList list) {
for (int i = 1; i < list.size(); i += 2) {
if (list.get(i - 1) >= list.get(i)) {
list.remove(i);
list.add(0, 0);
}
}
System.out.println(list);
} Write the output produced by the method when passed each of the following ArrayLists: List Output
a) [10, 20, 10, 5]
b) [8, 2, 9, 7, -1, 55]
c) [0, 16, 9, 1, 64, 25, 25, 14
Answer:
a)
int: [10, 20, 10, 5]
out: [0, 10, 20, 10]
b)
int: [8, 2, 9, 7, -1, 55]
out: [0, 0, 8, 9, -1, 55]
c)
int: [0, 16, 9, 1, 64, 25, 25, 14]
out: [0, 0, 0, 0, 16, 9, 64, 25]
Explanation:
What the code is doing is changing the list if and only if the item number i, where i is an odd position on the list, is greater than the item number i-1. If the condition mentioned is satisfied, the element number i is removed, and a zero is added to the beginning of the list; this is why the dimension of the input is equal to the output (for every element removed a zero is added).
Note:
The first item of a list is the item 0.add method can receive two parameters the first indicating the position where the element will be added and the second the element to be added. .get method allows you to select any element on the list by its index..size method gives you the size of the listIn the for loop i += 2 indicates an increment of two, since we start with i = 1 we are going to iterate through odd numbers i = 1,3,5,7...
Print person1's kids, call the incNumKids() method, and print again, outputting text as below. End each line with a newline.Sample output for below program with input 3:Kids: 3New baby, kids now: 4// ===== Code from file PersonInfo.java =====public class PersonInfo { private int numKids; public void setNumKids(int setPersonsKids) { numKids = setPersonsKids; } public void incNumKids() { numKids = numKids + 1; } public int getNumKids() { return numKids; }}// ===== end =====// ===== Code from file CallPersonInfo.java =====import java.util.Scanner;public class CallPersonInfo { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); PersonInfo person1 = new PersonInfo(); int personsKid; personsKid = scnr.nextInt(); person1.setNumKids(personsKid); /* Your solution goes here */ }}// ===== end =====
Answer:
System.out.println("Kids: " + person1.getNumKids());
person1.incNumKids();
System.out.println("New baby, kids now: " + person1.getNumKids());
Explanation:
Reminder: To be able to call a function that is inside a class, we need to use an object of that class. In this case, person1 is our object. If we would like to access any function, we need to type person1.functionName().
1) We need to call getNumKids() to get how many kids they have (It is 3 because user inputs 3 and it is set to the this value using setNumKids() function). To call this function, we need to use person1 object that is created earlier in the main function. To be able to print the result, we call the function inside the System.out.println().
2) To increase the number of kids, we need to call incNumKids() method with person1 object again. This way number of kids are increased by one, meaning they have 4 kids now.
3) To get the current number of kids, we need to call getNumKids() function using person1 object. To be able to print the result, we call the function inside the System.out.println().
Answer:
System.out.println("Kids: " + person1.getNumKids());
person1.incNumKids();
System.out.println("New baby, kids now: " + person1.getNumKids());
Explanation:
If you think a query is misspelled, which of the following should you do? Select all that apply.
A) Assign a low utility rating to all results because misspelled queries don't deserve high utility ratings.
B) Release the task.
C) For obviously misspelled queries, base the utility rating on user intent.
D) For obviously misspelled queries, assign a Low or Lowest Page Quality (PQ) rating.
Answer:
The answer is: letter C, For obviously misspelled queries, base the utility rating on user intent.
Explanation:
The question above is related to the job of a "Search Quality Rater." There are several guidelines which the rater needs to consider in evaluating users' queries. One of these is the "User's Intent." This refers to the goal of the user. A user will type something in the search engine because he is trying to look for something.
In the event that the user "obviously" misspelled queries, the rate should be based on his intent. It should never be based on why the query was misspelled or how it was spelled. So, no matter what the query looks like, you should assume that the user is, indeed, searching for something.
Rating the query will depend upon how relevant or useful it is and whether it is off topic.
Answer:
C) For obviously misspelled queries, base the utility rating on user intent.
Explanation:
Query is the term used to describe a language that the computer uses to perform query activities in different databases. It is important that the query is done correctly, or the data found by it may not be ideal for what the user is looking for. However, if the user suspects that a query is showing inefficient results, or that the query is incorrect, the ideal thing to do is to make sure that the query is incorrect and obtain results based on the utility rating on user intent.
Write a complete C program to run on the MSP432 platform to do the following:
Declare an array of size 3 x 7 of type uint8_t. Use loops to initialize each array element to contain the value of the sum of its indices (e.g., for element arr[2][5], write a value of 7 to arr[2][5], write a value of 7 to arr[1][6], etc.). Use additional loops to go through the array and test each value – if a value is not a multiple of 5, add that value to a cumulative sum and write a zero to the array element. If it is a multiple of 5, leave it untouched. Print the final result as a 16-bit integer value (the sum of the array elements not multiples of 5). Be sure to compile it in CCS to catch any syntax errors.
Answer:
The C code is given below with appropriate comments
Explanation:
#include <stdio.h>
int main()
{
//array declaration
int arr[3][7], cumulativeSum = 0;
//initialize the array
for(int i=0; i<3; i++)
{
for(int j=0; j<7; j++)
{
arr[i][j] = i+j;
}
}
//calculate the cumulative sum
for(int i=0; i<3; i++)
{
for(int j=0; j<7; j++)
{
if((arr[i][j] % 5) != 0)
{
cumulativeSum += arr[i][j];
arr[i][j] = 0;
}
}
}
//display the final array
printf("The final array is: \n\n");
for(int i=0; i<3; i++)
{
for(int j=0; j<7; j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
//display the cumulative sum
printf("\nCumulative Sum = %d", cumulativeSum);
return 0;
}
Write a statement that outputs variable userNum. End with a newline.
Answer:
System.out.println(userNum);
Explanation:
Using Java programming language, lets assume the variable userNum is entered by a user. The code snippet below will prompt the user to enter a number and output the the variable:
import java.util.Scanner;
public class TestClass {
public static void main(String[] args) {
System.out.println("Enter a number");
Scanner input = new Scanner(System.in);
int userNum = input.nextInt();
System.out.println(userNum);
}
}
Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call findMax() twice in an expression.
import java.util.Scanner;
public class SumOfMax {
public static double findMax(double num1, double num2) {
double maxVal = 0.0;
// Note: if-else statements need not be understood to
// complete this activity
if (num1 > num2) { // if num1 is greater than num2,
maxVal = num1; // then num1 is the maxVal.
}
else { // Otherwise,
maxVal = num2; // num2 is the maxVal.
}
return maxVal;
}
public static void main(String [] args) {
double numA = 5.0;
double numB = 10.0;
double numY = 3.0;
double numZ = 7.0;
double maxSum = 0.0;
/* Your solution goes here */
System.out.print("maxSum is: " + maxSum);
return;
}
}
Answer:
maxSum=findMax(numA,numB)+findMax(numY,numZ);
Explanation:
In the above statement, a function is used twice to calculate the maximum of 2 numbers passed as parameters of type double and returns the maximum value of type double as well. As the function is static, so, there is no need to make an object of the class in which the function is made. After finding the largest of both the pairs, the values are added and printed to console.
Answer:
maxSum = findMax(numA, numB); // first call of findMax
maxSum = maxSum + findMax(numY, numZ); // second call
Explanation:
how to hold numeric ranges and corresponding letter grade will be stored in a file java
Answer:
Print the grades on this Logic , this is logic for program and code is written under explanation.
If the average of marks is >= 80 then prints Grade ‘A’
If the average is <80 and >=70 then prints Grade ‘B’
If the average is <70 and >=60 then prints Grade ‘C’
else prints Grade ‘D’
Explanation
import java.util.Scanner;
public class JavaGradeProgram
{
public static void main(String args[])
{
/* This program assumes that the student has 6 subjects that's why I have created the array of size 6. You can change this as per the requirement. */
int marks[] = new int[6];
int i;
float total=0, avg;
Scanner scanner = new Scanner(System.in);
for(i=0; i<6; i++) {
System.out.print("Enter Marks of Subject"+(i+1)+":");
marks[i] = scanner.nextInt();
total = total + marks[i];
}
scanner.close();
Calculate Average Here:
avg = total /6 ;
if(avg >=80)
{
system.out.print("A");
}
else if(avg>=70 && avg <=80)
{
system.out.print("B");
}
else if(avg>=60 && avg <=70)
{
system.out.print("C");
}
else
{
system.out.print("D");
}
}
}
Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. Each of the numbers should be the modified roll from one simulation. Then, call your function once to compute an array of 7 simulated modified rolls. Name that array observations.
Final answer:
The 'simulate_observations' Python function simulates rolling a six-sided die 7 times, storing the results in an array named 'observations'.
Explanation:
To write a Python function called simulate_observations which returns an array of 7 simulated modified rolls, we can use the random module's randint function to simulate the rolling of a six-sided die. The code snippet below defines the function that generates 7 random numbers, each representing the outcome of a die roll, and stores them in an array called observations.
import random
def simulate_observations():
results = []
for _ in range(7):
roll = random.randint(1, 6)
results.append(roll)
return results
observations = simulate_observations()
print(observations)
Each number in the array would be between 1 and 6, representing each side of a fair, six-sided die. Note that the modification mentioned in the question is not specified, thus the standard roll result is used.
The Python function simulate_observations generates an array of 7 modified dice rolls and returns it. The example provided shows step-by-step how to implement and modify the rolls. The resulting array is stored in 'observations'.
To create a Python function called simulate_observations that returns an array of 7 modified dice rolls, you can follow these steps:
Define the function simulate_observations that uses the random module to generate random numbers simulating dice rolls.
Modify each simulated dice roll as specified (for example, by adding a constant to each roll).
Return the array of modified rolls.
Here's an implementation of the function:
import randomThis code will generate 7 random dice rolls, modify each by adding 1, and store them in the observations array. The mean expectation for dice rolls, centered around 3.5 for a fair six-sided die, is slightly adjusted due to modification.
A(n) ____________________ is the collection of individuals responsible for the overall planning and development of the contingency planning process.
Answer:
Contingency Planning Management Team (CPMT)
Explanation:
:)
Which type of security policy is intended to provide a common understandingof the purposes for which an employee can and cannot use a resource?a.issue-specificb.system-specificc.enterprise informationd.user-specific
Answer:A. ISSUE-SPECIFIC
Explanation:Security policy is a set of actions an organization,Country , State or local governments put in place on order to guarantee the security of life and properties. It can also be described as the restrictions on behavior or actions of members of a society, community or an organization as well as restrictions imposed on adversaries by processes such as doors, locks, keys and walls.
Issue specific policy are policies directed to treat or handle particular factors known to aid or abate a crime. It can also be used to outline or reach at an understanding of what to used or what not to use in order to ensure effective security in an organization.
What technology would you like to use or see developed that would help you be a "citizen of the world"?
Answer and explanation:
While traveling abroad the main barrier to be considered is language. Entrepreneurs should focus special attention on developing mobile apps that interpret people's segments accurately so regardless of the country and language they can communicate through the app and make them feel they are "citizens of the world".
Open Comments.java and write a class that uses the command window to display the following statement about comments:
Program comments are nonexecuting statements you add to a file for the purpose of documentation.
Also include the same statement in three different comments in the class; each comment should use one of the three different methods of including comments in a Java class.
Answer:
Answers to the code are given below with appropriate guidelines on definitions and how to properly run the code
Explanation:
//3 ways to comment are as follows:
//1. This is a one line comment.
/**
* 2. This is a documentation comment.
* @author Your name here
*
*/
/*
*3. This is a multiple line comment
* */
public class Comments {
//Driver method
public static void main(String[]args) {
/*
* All the text written inside the
* sysout method will be displayed on
* to the command prompt/console*/
System.out.println("Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n");
System.out.println("3 ways to add comments in JAVA are as follows: \n");
System.out.println("1. One line comment can be written as:\n//Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n");
System.out.println("2. MultiLine comment can be written as:\n/* Program comments are nonexecuting \n * statements you add to a file for the \n * purpose of documentation.\n */\n");
System.out.println("3. Documentation comment can be written as follows:\n/**\n * Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n **/");
}
}
Steps to Run:
1. Make file named Comments.java, and copy paste the above code.
2. Open command prompt and then go to the directory where you have saved the above created file.
3. The before running compile the code by using command
javac Comments.java
4. Now, run the code by the below command
java Comments.
Congrats your assignment is done!!
Suppose you are a project manager who typically has been using a waterfall development-based methodology on a large and complex project. Your manager has just read the latest article in Computerworld that advocates replacing this methodology with the Unified Process and comes to you requesting you to switch. What do you say?
Answer:
Answer explained below
Explanation:
Depending upon the current situation we can switch. That means suppose the entire project is mid way that means we already implemented the project by Waterfall methodology then it would take lot of time to switch to Prototype model. Again if we see the efficiency I mean if we complete the project using prototype model and the outcome would be very well and robust then we should definitely switch to prototype model. So depending on the scenario we need to decide whether it would be beneficial to switch or not.
Further, we have the differences between Waterfall and Prototype :
I) In case of Waterfall model requirements should be very well known. On the other hand in case of prototype model if the user requirements are not complete then we can choose prototype model.
II) Technical issues should be cleared in case of Waterfall model, on the other hand technical requirements need not be clear.
Advantages of Waterfall:
I) Easy to understand this model and easy to use.
II) It provides structure to inexperienced staff
III) Milestones are well understood
IV) Set requirements stability
Disadvantages of Waterfall Model:
I) All requirements must be known upfront
II) Inhibits flexibility
III) Can give a false impression of progree
Advantage of Prototype Model:
I) Even if user requirements are not complete we can use
II) Even if technical issues are not clear we can use
Disadvantage of Prototype:
I) The Model is complex
II) Risk Assessment expertise is required
III)Time spent for evaluating risks too large for small projects.
Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 seconds to compress 60%.
(a) Calculate the bandwidth at which each compression option takes the same total compression + transmission time.
(b) Explain why latency does not affect your answer.
Answer: bandwidth = 0.10 MB/s
Explanation:
Given
Total Time = Compression Time + Transmission Time
Transmission Time = RTT + (1 / Bandwidth) xTransferSize
Transmission Time = RTT + (0.50 MB / Bandwidth)
Transfer Size = 0.50 MB
Total Time = Compression Time + RTT + (0.50 MB /Bandwidth)
Total Time = 1 s + RTT + (0.50 MB / Bandwidth)
Compression Time = 1 sec
Situation B:
Total Time = Compression Time + Transmission Time
Transmission Time = RTT + (1 / Bandwidth) xTransferSize
Transmission Time = RTT + (0.40 MB / Bandwidth)
Transfer Size = 0.40 MB
Total Time = Compression Time + RTT + (0.40 MB /Bandwidth)
Total Time = 2 s + RTT + (0.40 MB / Bandwidth)
Compression Time = 2 sec
Setting the total times equal:
1 s + RTT + (0.50 MB / Bandwidth) = 2 s + RTT + (0.40 MB /Bandwidth)
As the equation is simplified, the RTT term drops out(which will be discussed later):
1 s + (0.50 MB / Bandwidth) = 2 s + (0.40 MB /Bandwidth)
Like terms are collected:
(0.50 MB / Bandwidth) - (0.40 MB / Bandwidth) = 2 s - 1s
0.10 MB / Bandwidth = 1 s
Algebra is applied:
0.10 MB / 1 s = Bandwidth
Simplify:
0.10 MB/s = Bandwidth
The bandwidth, at which the two total times are equivalent, is 0.10 MB/s, or 800 kbps.
(2) . Assume the RTT for the network connection is 200 ms.
For situtation 1:
Total Time = Compression Time + RTT + (1/Bandwidth) xTransferSize
Total Time = 1 sec + 0.200 sec + (1 / 0.10 MB/s) x 0.50 MB
Total Time = 1.2 sec + 5 sec
Total Time = 6.2 sec
For situation 2:
Total Time = Compression Time + RTT + (1/Bandwidth) xTransferSize
Total Time = 2 sec + 0.200 sec + (1 / 0.10 MB/s) x 0.40 MB
Total Time = 2.2 sec + 4 sec
Total Time = 6.2 sec
Thus, latency is not a factor.
Final answer:
The bandwidth at which each compression option (50% and 60%) takes the same total compression plus transmission time is 10 MBps. Latency does not impact this calculation because it is a separate factor from compression and transmission rates.
Explanation:
To calculate the bandwidth at which each compression option takes the same total compression + transmission time:
For 50% compression: The file size becomes 0.5 MB (50% of 1 MB) which requires 1 second of compression time. This gives a total of 0.5 MB to be transmitted.For 60% compression: The file size becomes 0.4 MB (40% of 1 MB) which requires 2 seconds of compression time. This gives a total of 0.4 MB to be transmitted.Let t be the transmission time and B be the bandwidth in MBps. The total time for both scenarios needs to be equal, so:
For 50% compression: 1 second (compression time) + (0.5 MB / B) = tFor 60% compression: 2 seconds (compression time) + (0.4 MB / B) = tSetting the equations equal to each other gives us:
1 + (0.5 / B) = 2 + (0.4 / B)
After solving, B = 10 MBps.
(b) Latency does not affect the answer because it refers to the delay before the transfer begins and does not impact the rate of data transmission or compression time.
A firm has a huge amount of individual customer data saved in different databases. Which of the following can be used to integrate, analyze, and apply the available information effectively?
a. online market research tools
b. integrated marketing systems
c. CRM systems
d. internal survey methods
e. quality assurance tools
Answer:
C. CMR systems
Explanation:
CMR or customer relationship management is a strategy that uses data analysis of customers to manage the interaction between a company and current and potential customers.
It analyses the data of client from different channels like wesites, email, social media,telephone log etc, describing and predicting potential decisions to be made to enhance customer service and acquisition.
With the rapid advance in information technologies, people around the world can access information quickly. Information takes the form of text, still pictures, video, sound, graphics, or animations, which are stored and transferred electronically through these computational technologies.
Answer: Word-for-word plagiarism
Explanation:
The student uses 7 straight words from the original text without applying quotations.
Final answer:
The Information Age is characterized by revolutionary technological advancements that have shifted economies from industrial to information-based. Information technology has facilitated the production, analysis, and dissemination of data, transforming it into valuable information. This era is marked by computer miniaturization and the growth of the Internet, which heavily influences daily life and potential ecological benefits.
Explanation:
In the Information Age, we have witnessed a monumental shift in how information is processed and disseminated, thanks to the rapid advancement of information technologies. This epoch is highlighted by the transition from the industrial economy to an information economy, greatly influenced by the advent of the personal computer in the late 1970s and the proliferation of the Internet in the early 1990s. The revolution in information technology has led to the miniaturization of electronics, integrating circuits and processing units, which are foundational to modern computing devices. These technological advancements have streamlined data collection, processing, and analysis, allowing vast amounts of data to be transformed into valuable information with applications spanning various fields and industries.
Data can be utilized repeatedly to generate new information when placed in context, answering questions, or providing insights, making it a significant commodity in today's world. The continuous evolution of computers and communications networks is a testament to how deeply embedded technology has become in daily life. Importantly, information and communications technology (ICT) not only encompasses traditional devices such as computers and smartphones but also potential future technologies like augmented reality glasses and virtual reality headgear.
The ecological benefits of these technological changes are also noteworthy. The Information Age may contribute to reduced natural resource consumption as societal functions such as shopping and working becomes increasingly digitized, potentially decreasing human energy consumption even as the economy grows. Overall, information technology continues to shape and redefine how we live, communicate, and interact with the world, marking a lasting impact on modern society.
How do you freeze the total cell so that it doesn't change when copied?
a) put a # in front of the letter and number that represents the cell position.
b) put a $ behind the letter and number that represents the cell position.
c) put a $ in front of the letter and number that represents the cell position.
d) you don't do anything, they are already frozen in Excel"
Answer:
c) put a $ in front of the letter and number that represents the cell position.
Explanation:
Dollar sign ($) is used to lock the formula in the cell. This is called absolute reference. In this type of referencing, A dollar sign is place in front of the letter and number to lock that cell. Whenever we copy that cell, the formula will be copied in other cell without changing its reference number.
As
Example 1
C1 = A1 + B1
if we copy this formula in C2 then it becomes
C2= A2 + B2
there both reference of A and B has been changed.
Example 2
If we put $ sign as
C1= $A$1 + $B$1
now of we copy C1 and into C2
C2= $A$1 + $B$1
There reference of cell is not changed.
To freeze a cell in Excel, use the dollar sign ($) in front of the letter and number of the cell position. For example, if the total cell is A1, change it to $A$1. This technique ensures Excel maintains the cell reference when copying the formula.
Explanation:To freeze a total cell in Excel so that it doesn't change when copied, you should use the dollar sign ($) in front of the letter and number that represent the cell position. This operation is commonly referred to as cell referencing. For instance, if your total cell is A1, you would change it to $A$1 to freeze it.
The dollar sign instructs Excel to maintain the reference to the specific cell when you copy the formula to other cells. Without the dollar sign, Excel will adjust the formula to refer to relative cells. Therefore, option (c) is the correct technique for freezing the total cell in Excel.
Learn more about Cell Referencing here:https://brainly.com/question/35910076
#SPJ3
Which of the following attack is a threat to confidentiality?
a. snooping
b. masquerading
c. repudiation
Answer:
The correct answer is letter "B": masquerading.
Explanation:
The attack referred to as masquerading simply consists of impersonating the identity of an authorized user of an information system. The impersonation could take place electronically -the user has a login and password that does not belong to him to access a server- or personally -employees accessing restricted areas of a company.
b. masquerading attack is a threat to confidentiality.
Masquerade terms can be as follows:
The term "masquerade" refers to the act of pretending to be someone else.Masquerading is a simple attack that involves faking the identity of an authorized user of an information system.Impersonation can occur either electronically (e.g., when a user uses a login and password which does not belong to him to access a server) or personally (e.g., when workers get access to restricted sections of a firm).Learn more: https://brainly.com/question/17085630
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.
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();
}
}
Evaluate the expression. Be sure to list a value of appropriate type (e.g., 7.0 rather than 7 for a double, Strings in quotes). 19 / 2 / 2.0 + 2.5 * 6 / 2 + 0.5 * 4
14.0
Explanation:Using the level of precedence in Java,
From left to right;
(i) the first division operation will be done.
(ii)followed by the second division operation.
(iii)followed by the first multiplication operation.
(iv)followed by the third division operation.
(v)followed by the second multiplication operation.
(vi) followed by the first addition operation.
(vii)lastly followed by the second addition operation.
=================================================
Taking the steps above one after the other;
(i) the first division operation will be done (i.e 19 / 2)
=> Integer division in Java gives an integer result. Therefore, 19 / 2 = 9.5 will give 9.
So,
=> 19 / 2 / 2.0 + 2.5 * 6 / 2 + 0.5 * 4
=> 9 / 2.0 + 2.5 * 6 / 2 + 0.5 * 4
(ii)followed by the second division operation. (i.e 9 / 2.0)
=> From the result from step (i), the second division operation is now 9 / 2.0.
=> 9 / 2.0 = 4.5
So,
=> 9 / 2.0 + 2.5 * 6 / 2 + 0.5 * 4
=> 4.5 + 2.5 * 6 / 2 + 0.5 * 4
(iii)followed by the first multiplication operation. (i.e 2.5 * 6)
=> The first multiplication operation is given by 2.5 * 6
=> 2.5 * 6 = 15.0
So,
=> 4.5 + 2.5 * 6 / 2 + 0.5 * 4
=> 4.5 + 15.0 / 2 + 0.5 * 4
(iv)followed by the third division operation. (i.e 15.0 / 2)
=> The third division operation is given by 15.0 / 2
=> 15.0 / 2 = 7.5
So,
=> 4.5 + 15.0 / 2 + 0.5 * 4
=> 4.5 + 7.5 + 0.5 * 4
(v)followed by the second multiplication operation. (i.e 0.5 * 4)
=> The second multiplication operation is given by 0.5 * 4
=> 0.5 * 4 = 2.0
So,
=> 4.5 + 7.5 + 0.5 * 4
=> 4.5 + 7.5 + 2.0
(vi) followed by the first addition operation. (i.e 4.5 + 7.5)
=> The first addition operation is given by 4.5 + 7.5
=> 4.5 + 7.5 = 12.0
So,
=> 4.5 + 7.5 + 2.0
=> 12.0 + 2.0
(vii) lastly followed by the second addition operation. (i.e 12.0 + 2.0)
=> The second addition operation is given by 12.0 + 2.0
=> 12.0 + 2.0 = 14.0
So,
=> 12.0 + 2.0
=> 14.0
Therefore, 19 / 2 / 2.0 + 2.5 * 6 / 2 + 0.5 * 4 = 14.0
Note:In Java, the order of precedence for arithmetic operators is;
=> /, * and %
=> followed by + and -
Given the multiplication 65535 x 32768, will the result cause overflow on a 32-bit system? Will the result need more than 32 bits to be stored in?
Answer:
65535 x 32768 =214 7450880
which is in the range of 32 bit unsigned integers, so there will be no overflow and we wont be in a need of more bits than 32 bit.
Explanation:
An overflow error indicates that software attempted to write down data beyond the bounds of memory.
Each program features a section of memory allocated for a stack. The stack is employed to store internal data for the program and is extremely fast and keep track of return addressing. A program may jump to a neighborhood that reads some data from the disk drive, then it returns from that routine to continue processing the info. The stack keeps track of the originating address, and therefore the program uses that for the return. Kind of like leaving breadcrumbs to seek out your way back. The stack features a limited amount of space for storing. If software attempts to access a neighborhood of the stack beyond its limits, an overflow error occurs.
• signed 32-bit integers support the range [-2147483648,2147483647]
• unsigned 32-bit integers support the range [0,4294967295]
And if you go outside this range, even temporarily, you would like to be very careful. Most cases handle the overflow technically and provide you "wraparound" or "modulo" behavior where carry bits outside the range just disappear and you're left with the low-order bits like the precise result.
In computer architecture of 32 bit, memory addresses, or other data units are those who are 32 bits (4 octets) wide. Also, 32-bit CPU and ALU architectures are those who have supported registers, address buses, or data buses of that size. 32-bit microcomputers are computers during which 32-bit microprocessors are the norm.
Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat, including after the last. Ex: numRows = 2 and numColumns = 3 prints:
1A 1B 1C 2A 2B 2C
#include
using namespace std;
int main() {
int numRows;
int numColumns;
int currentRow;
int currentColumn;
char currentColumnLetter;
cin >> numRows;
cin >> numColumns;
/* Your solution goes here */
cout << endl;
return 0;
}
The summary of the missing instructions in the program are:
Looping statements to iterate through the rows and the columnA print statement to print each seatThe solution could not be submitted directly. So, I've added it as attachments.
The first attachment is the complete explanation (that could not be submitted)The second attachment is the complete source file of the corrected codeRead more about C++ programs at:
https://brainly.com/question/12063363
Software licensing is a major problem in cloud computing. Discuss several ideas to prevent an administrator from hijacking the authorization to use a software license.
Answer:
Yes, the software license is a major problem in cloud computing.
Explanation:
The ad network administrator or system administrator he or she has to buy hardware appliance such server, firewall protection and operating system and their licenses. Each purchase is addon cost to and depends on the organization decided on the investment process.
Moreover, the system administrator should do daily routine check the patches of the operating system and firewall and schedule checking has to be made and update the firewall. In case if any hijacking taking place he has to contact immediately the hardware firewall supplier or service provider for help
In clouds, all threats are taken care and the network administrator only has to check any new supporting software that has to update in the client pc or workstation and laptop.
As an investor of organizations has to compare cloud licenses cost and local hardware appliance and software licenses and has to make a decision.
Which of the following commands would you use to start the program Main with four strings? a. java Main arg0 arg1 arg2 arg3 b. java Main argo arg1 arg 2 arg3 arg4c. java Main argo arg1d. java Main argo arg1 arg 2
Answer:
A java Main arg0 arg1 arg2 arg3
Explanation:
The bee may travel to a different species of plant, so the pollen may not fertilize another flower. The wind can blow the dandelion seeds into an area where they can’t sprout. The squirrel might come back for the seeds it buried in the ground
secops focuses on integrating the need for the development team to provide iterative and rapid improvement to system functionality and the need for the operation team to improve and security and minimize the disruption from software release cyces_____________.
A. True.B. False.
Answer:
A. True.
Explanation:
Secops or security- operation is a mechanism that focus on merging and collaborating the security team and the development operation team. It is made to prevent, sacrificing one for the other like the security of an application for the functionality and development of the application.
It tries to create communication between both teams, for every decision made to equally and positively affect both teams operation and result.
Workspace Remember for a moment a recent trip you have made to the grocery store to pick up a few items. What pieces of data did the Point of Sale (POS) terminal and cashier collect from you and what pieces of data about the transaction did the POS terminal pull from a database to complete the sale? In addition to the data collected and retrieved what information was generated by the POS terminal at the end of the order, as it is being completed?
Answer:
ATM card and the pin number, the status of the bank account and the total of the purchase and the account and method of payment.
Explanation:
The POS or point of service is a device that allows the purchase of product from a commercial store to be done wirelessly and cashless.
It promotes The cashless policy to reduce the circulating physical currency. The POS electromagnetic wave to wirelessly access bank database to retrieve bank account information.
It takes in the smart card, and with the command, retrieves the bank account information addressed on the card. The cashier types the total price of purchased product and it is automatically minus and updated on the account database. Then the invoice of the transaction is issued to the customer.
A sysadmin is looking to use Pre Booth Execution over a network by keeping operating system installation files on a server. Which type of server is this most likely to be?
SFTP server
TFTP server
FTP server
DNS server
Answer:
The correct answer is letter "B": TFTP server.
Explanation:
A TFTP server allows the system administrator to install programs on other computers from the same network and keeping a registry. This is mainly done to prevent loss of information in the case the network is corrupted or if one of the computers is infected with malicious software.
A(n) ___________ is one of the most common examples of redundancy built into a network to helpreduce the impact of disruption.
a.network cloaking device
b.backup punch card reader
c.uninterruptible power supply
d.service level agreemente.help desk
Answer:
C. Uninterrupted power supply.
Explanation:
Uninterrupted power supply or UPS is device that is connected to the main power supply of a system or a network of computer systems to provide power, when the main power supply is down. It promotes power redundancy for a reliable network.
Network cloaking device is used to hide a networks domain name, while it is being broadcast across.
The backup punch card is an outdated technology used for recording digital data.
Service level agreement is a documented agreement between the services providers and companies, on the method or form of service to be rendered.
Answer:
c.uninterruptible power supply
Explanation:
Disruption means disturbance or problems which interrupt an event, activity, or process.
Uninterrupted power supply helps to prevent our system from being interrupted while functioning.
Which sort algorithm does the following outline define? for i between 0 and number_used-1 inclusivea. sequential b. non-sequential
Final answer:
The question outline suggests a sequential, iterative approach, consistent with various sorting algorithms like bubble sort, insertion sort, or selection sort, but it is not possible to determine exactly which algorithm is defined without more details.
Explanation:
The algorithm described in the question is not fully detailed, but the mention of for i between 0 and number used-1 inclusive suggests that elements are being processed sequentially, implying an iterative approach. This could be consistent with various sorting algorithms that traverse elements in a sequence, such as bubble sort, insertion sort, or selection sort. However, without additional information on what is specifically happening within the loop or any other steps of the algorithm, it is impossible to definitively determine which sort algorithm is being outlined.