The four compass points can be abbreviated by single-letter strings as "N", "E", "S", and "W". Write a function turn_clockwise that takes one of these four compass points as its parameter, and returns the next compass point in the clockwise direction. Here are some tests that should pass:
test(turn_clockwise("N") == "E")
test(turn_clockwise("W") == "N")
You might ask "What if the argument to the function is some other value?" For all other
cases, the function should return the value None:
test(turn_clockwise(42) == None)
test(turn_clockwise("rubbish") == None)

Answers

Answer 1

Answer:

The program code is written in the explanation.

Explanation:

def turn_clockwise(d):

if d=="N":

return "E"

elif d=="E":

return "S"

elif d=="S":

return "W"

elif d=="W":

return "N"

else:

return "None"

Output:

The Four Compass Points Can Be Abbreviated By Single-letter Strings As "N", "E", "S", And "W". Write

Related Questions

Explain why you cannot the Apple OS install on a regular windows computer and vice versa, without the aid of a virtualization software explain Virtualbox, parallel desktop, etc. In your response, explain why it works with a virtualization software.

Answers

Answer:

The reason is due to proprietary design of the Operating System (OS) which require a virtualization software to blanket or "disguise" the hardware (processor) borderlines of the computer onto which it is to be installed.

Explanation:

An Apple system that has the RISC processor and system architecture which has an operating system made entirely for the Apple system architecture

If the above Apple OS is to be installed on a windows computer, then the procedure to setup up the OS has to be the same as that used when on an Apple system, hence, due to the different processors and components of both systems, a virtualization will be be needed to be provided by a Virtual box, Parallels desktop or other virtualization software.

Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. It should acknowledge the user in the following format. For the first pet, it should say "You have a dog with a total of 1 pet(s)" if they enter dog, and so on.
Sample Run:
User enters:
lemur parrot cat rock
Outputs:
You have a lemur with a total of 1 pet(s)
You have a parrot with a total of 2 pet(s)
You have a cat with a total of 3 pet(s)

Answers

Answer:

Check the explanation

Explanation:

The Python program that frequently asks the user what pets the user has,

until the user enters "rock", in which case the loop ends can be analysed in the written codes below.

'''

# count of pets

count = 0

# read the user input

pet = input()

# loop that continues till the user enters rock

# strip is used to remove the whitespace

while pet.strip() != 'rock':

  # increment the count of pets

  count += 1

  # output the pet name and number of pets read till now

  print('You have a %s with a total of %d pet(s)' %(pet.strip(),count))

  pet = input() # input the next pet

#end of program

Following are the python program to use the loop to count the number of pets until the user enters the "rock":

Program:

c = 0#defining a variable c that initilzes with 0

p = input()#defining a variable p that input value

while p != 'rock':#defining a loop that check p value not equal to rock

  c += 1#using c variable for counts total number of pets

  print('You have a %s with a total of %d pet(s)' %(p,c))#print total number of pet

  p = input() #input value

Output:

Please find the attached file.

Program Explanation:

Defining a variable "c" that is initialized with 0, which is used to count input values.In the next line, a "p" variable is declared as the input value from the user end.A while loop is declared to check that the p-value is not equal to 'rock'.Inside this loop, the "c" variable is used for counting the total number of pets, and a print method is used to print the total number of pets.Another input method is used that works until the user inputs the value that is "rock".

Find out more about the loop here:

brainly.com/question/17067964

Computer security experts devote their time and energy to the protection of sensitive data and the prevention of an outside attack on the internal network. They specialize in building secure firewalls as well as complex intrusion detection systems designed to keep intruders out. They watch and monitor the incoming message traffic very closely. But no matter how well they protect the private network from outside access without proper authority, they do not help prevent an attack by a malicious or disgruntled employee from the inside. And they cannot prevent breaches due to a simple lack of understanding of security policy by internal employees.When do YOU think an organization needs information systems security policies? Why?

Answers

Answer:

Information security policy are used for the prevention of intruders hacking a network when an organization start getting IT related attacks.

Explanation:

Information security policy are used for the prevention of intruders hacking a network when an organization start getting IT related attacks.

An information security policy are set of rules/policies designed to guide employees for the protection of the security of company information and IT systems. The reasons for these policies are:

It defines what is required from organization’s employees for the security of the IT systemsInformation security policies provide a means to secure the organization against external and internal threats Information security policies are a mechanism to for ensuring an organization’s legal and ethical responsibilities Information security policies are created to hold each employee responsible with regard to information security

A MySetOperations is a collection of functions, on which the following set operations are defined:
myIsEmpty(A): Returns T if the set A is empty (A = Φ), F otherwise.
myDisjoint(A,B): Returns T if intersection of the set A and set B is non-empty
(A â© B â  Î¦), F otherwise.
myIntersection(A,B): Returns the intersection of the set A and set B (A â© B).
myUnion(A,B): Returns the union of the set A and set B (A ⪠B).
Write a collection of MySetOperations in Python.
Note: For this problem, you can use only the standard flow Python's instructions and the set build-in operations: len, in, not in, and add.

Answers

Answer:

Explanation:

The objective here is to write a collection of MySetOperations in Python.

During the process of  submitting this answer after computing the program ; I keep getting a response message that goes thus "It appears that your answer contains either a link or inappropriate words. Please correct and submit again!"  . In the bid to curb such dilemma , i have created a word document for the collection of MySetOperations in Python.

The document can be seen in the attached file below.

1.Start vim to create a new file named pizza. vim pizza 2.Type i (lowercase i for input to put vim in Input mode and enter the following text, pressing RETURN at the end of each line. Ignore typing mistakes you make for now. Press ESCAPE when you are done typing to put vim back in Command mode. Pizza is an oven-baked, flat, round bread typically topped with a tomato sauce, cheese and various toppings. Pizza was originally invented in Naples, Italy, and the dish has since become popular in many parts of the world. (from Wikipedia) I

Answers

Answer:

vi [ -| -s ] [-l] [-L] [-R] [ -r [ filename ] ] [-S] [-t tag] [-v] [-V]

  [-x] [-w] [-n ] [-C] [+command | -c command ] filename

Explanation:

See attached image file

Suppose an 80286 microprocessor is in protected mode. How it is switched back
to real address mode operations.

Answers

Answer:

  hardware-initiated reset

Explanation:

Once in protected mode, the 80286 is designed to remain there until it is reset by hardware.

__

External hardware can be designed so that software can cause such a reset. In the 1984 PC/AT, such hardware combined with code in the BIOS allowed real mode re-entry and returned execution control to the program that caused the reset.


A customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft PowerPoint application for the purpose of practicing presentation skills. As a salesperson what size hard disc would you recommend and why?

Answers

Answer:

at this day and age, any. My questions would focus around other applications at this point.  250 gb or larger.

Explanation:

Office 365 only uses 4 GB "Microsoft's store page", the smallest hard drives commonly available are 250 GB and larger.  

You are building a predictive solution based on web server log data. The data is collected in a comma-separated values (CSV) format that always includes the following fields: date: string time: string client_ip: string server_ip: string url_stem: string url_query: string client_bytes: integer server_bytes: integer You want to load the data into a DataFrame for analysis. You must load the data in the correct format while minimizing the processing overhead on the Spark cluster. What should you do? Load the data as lines of text into an RDD, then split the text based on a comma-delimiter and load the RDD into a DataFrame. Define a schema for the data, then read the data from the CSV file into a DataFrame using the schema. Read the data from the CSV file into a DataFrame, infering the schema. Convert the data to tab-delimited format, then read the data from the text file into a DataFrame, infering the schema.

Answers

Answer:

see explaination

Explanation:

The data is collected in a comma-separated values (CSV) format that always includes the following fields:

? date: string

? time: string

? client_ip: string

? server_ip: string

? url_stem: string

? url_query: string

? client_bytes: integer

? server_bytes: integer

What should you do?

a. Load the data as lines of text into an RDD, then split the text based on a comma-delimiter and load the RDD into DataFrame.

# import the module csv

import csv

import pandas as pd

# open the csv file

with open(r"C:\Users\uname\Downloads\abc.csv") as csv_file:

# read the csv file

csv_reader = csv.reader(csv_file, delimiter=',')

# now we can use this csv files into the pandas

df = pd.DataFrame([csv_reader], index=None)

df.head()

b. Define a schema for the data, then read the data from the CSV file into a DataFrame using the schema.

from pyspark.sql.types import *

from pyspark.sql import SparkSession

newschema = StructType([

StructField("date", DateType(),true),

StructField("time", DateType(),true),

StructField("client_ip", StringType(),true),

StructField("server_ip", StringType(),true),

StructField("url_stem", StringType(),true),

StructField("url_query", StringType(),true),

StructField("client_bytes", IntegerType(),true),

StructField("server_bytes", IntegerType(),true])

c. Read the data from the CSV file into a DataFrame, infering the schema.

abc_DF = spark.read.load('C:\Users\uname\Downloads\new_abc.csv', format="csv", header="true", sep=' ', schema=newSchema)

d. Convert the data to tab-delimited format, then read the data from the text file into a DataFrame, infering the schema.

Import pandas as pd

Df2 = pd.read_csv(‘new_abc.csv’,delimiter="\t")

print('Contents of Dataframe : ')

print(Df2)

The style or appearance of text is called

Answers

font or typeface, defines the appearance and shape of the letters, numbers, and special characters. font size. specifies the size of the characters and is determined by a measurement system called points. format.

Answer: Font

Explanation:

____ is scientifically seeking and discovering facts.

Answers

Answer:

I believe it is science, but before you do anything with this answer, research more on it, just in case I'm wrong! :)

Explanation:

in most operating systems what is running application called?

Answers

Answer:

I believe it is just a task. Since there exists(on windows) the Task Manager application, where you can stop any running task, I think that they are called tasks

Explanation:

In most operating systems, a running application is typically referred to as a process. A process is an instance of a program that is being executed by the operating system. It represents the execution of a set of instructions and includes the program code, data, and resources required for its execution.

Each process has its own virtual address space, which contains the program's code, variables, and dynamically allocated memory. The operating system manages and schedules these processes, allocating system resources such as CPU time, memory, and input/output devices to ensure their proper execution.

The operating system provides various mechanisms to manage processes, such as process creation, termination, scheduling, and inter-process communication.

Learn more about operating systems here:

brainly.com/question/33924668

#SPJ6

The code below uses the Space macro which simply displays the number of blank spaces specified by its argument. What is the first number printed to the screen after this code executes? (ignore the .0000 from Canvas) main PROC push 4 push 13 call rcrsn exit main ENDP rcrsn PROC push ebp mov ebp,esp mov eax,[ebp + 12] mov ebx,[ebp + 8] cmp eax,ebx jl recurse jmp quit recurse: inc eax push eax push ebx call rcrsn mov eax,[ebp + 12] call WriteDec Space 2 quit: pop ebp ret 8 rcrsn ENDP

Answers

Answer:

The code implements a recursive function by decrementing number  by 1 from 10 to 4 recursively from the stack and add an extra space 2 using  the macro function

Explanation:

Solution

The  code implements a recursive function by decrementing number  by 1 from 10 to 4 recursively from the stack and add an extra space 2 using  the macro function mwritespace

The first number is printed after the code executes is 9

Code to be used:

Include Irvine32.inc

INCLUDE Macros.inc               ;Include macros for space

.code

main proc

  push 4                   ;Push 4 to the stack

  push 10                   ;Push 10 to the stack

  call rcrsn                   ;call the function  

  exit

  ;invoke ExitProcess,0           ;After return from the function

                      ;call exit function

  main ENDP               ;end the main

  rcrsn PROC               ;define the function

      push ebp               ;push the ebp into stack

      mov ebp,esp           ;set ebp as frame pointer

      mov eax,[ebp + 12]       ;This is for second parameter

      mov ebx,[ebp + 8]       ;This is for first parameter

      cmp eax,ebx           ;compare the registers

      jl recurse           ;jump to another function  

      jmp quit               ;call quit

      recurse:               ;Implement another function  

      inc eax               ;increment count value

      push eax               ;push the eax value into stack

      push ebx               ;push ebx into stack

      call rcrsn           ;call above function

      mov eax,[ebp + 12]       ;This is for second parameter

      call WriteDec           ;write the value on the screen

      mWritespace 2           ;Space macro print 2 spaces

                      ;pause the screen

      quit:               ;Implement quit function

      pop ebp               ;pop the pointer value from the stack

      ret 8               ;clean up the stack  

 rcrsn ENDP          

end main

p25: File Write and Read1) User enters a file name (such as "myMovies.txt").2) User enters the titles of 4 of their favorite moveis (use a loop!).3) Program Writes the 4 titles to a file, one per line, then closes the file (use a loop!).4) Program Reads the 4 titles from "myMovies.txt" stores them in a list and shows the list5) The program writes the titles in reverse order into a file "reverseOrder.txt"Sample Run:Please enter a file name: myMovies.txtPlease enter a movie title #1: movie1Please enter a movie title #2: movie2Please enter a movie title #3: movie3Please enter a movie title #4: movie4Writing the 4 movie titles to file 'myMovies.txt'Reading the 4 movie titles from file into a list: [movie1, movie2, movie3, movie4]Writing the 4 movie titles in revers to 'reverseOrder.txt'Note: Do not use reverse() , reversed()Content of myMovies.txt:movie1movie2movie3movie4Content of reverseOrder.txtmovie4movie3movie2movie1

Answers

Answer:

The program goes as follows  

Comments are used to explain difficult lines

#include<iostream>

#include<fstream>

#include<sstream>

#include<string>

using namespace std;

int main()

{

//Declare String to accept file name

string nm;

//Prompt user for file name

cout<<"Enter File Name: ";

getline(cin,nm);

//Create File

ofstream Myfile(nm.c_str());

//Prompt user for 4 names of movies

string movie;

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

{

 cout<<"Please enter a movie title #"<<i<<": ";

 cin>>movie;

 //Write to file, the names of each movies

 Myfile<<movie<<endl;

}

Myfile.close(); // Close file

//Create an Array for four elements

string myArr[4];

//Prepare to read from file to array

ifstream file(nm.c_str());

//Open File

if(file.is_open())

{

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

 {

  //Read each line of the file to array (line by line)

  file>>myArr[i];

 }

}

file.close(); // Close file

//Create a reverseOrder.txt file

nm = "reverseOrder.txt";

//Prepare to read into file

ofstream Myfile2(nm.c_str());

for(int j = 3;j>=0;j--)

{

 //Read each line of the file to reverseOrder.txt (line by line)

 Myfile2<<myArr[j]<<endl;

}

Myfile2.close(); //Close File

return 0;

}

See attached for .cpp program file

The following table contains data about projects and the hours charged against them:
ProjectBilling:
ProjectNbr ProjectName EmployeeNbr EmployeeName JobClass HourlyRate HoursBilled
15 Evergreen 103 June Phillips SA-3 96.75 23.8
15 Evergreen 101 John Baker DD-5 105.00 19.4
15 Evergreen 105 Alice Miller DD-5 105.00 35.7
15 Evergreen 106 William Smithfield SA-2 62.50 12.6
18 Amber Wave 114 Anna Jones SA-1 55.00 23.8
18 Amber Wave 101 John Baker DD-5 105.00 24.6
18 Amber Wave 112 Brad White SA-3 96.75 45.3
22 Starlight 107 Terry Ray SA-2 62.50 32.4
22 Starlight 115 Peter Novak SA-3 96.75 44.0
22 Starlight 101 John Baker DD-5 105.00 64.7
22 Starlight 114 Anna Jones SA-1 55.00 48.4
22 Starlight 108 Susan Brown SA-2 62.50 23.6
(A) Convert the table to 3NF.

Answers

Answer:

The final tables in 3NF are as follows.

Project( ProjectNbr, ProjectName)

Employee( EmployeeNbr, EmployeeName, JobClass)

Job( JobClass, HourlyRate)

ProjectBilling( ProjectNbr, EmployeeNbr, HoursBilled)

Explanation:

The given table is given below.

ProjectBilling( ProjectNbr, ProjectName, EmployeeNbr, EmployeeName, JobClass, HourlyRate, HoursBilled)  

ProjectNbr -> ProjectName

EmployeeNbr -> EmployeeName  

JobClass -> HourlyRate

ProjectNbr, EmployeeNbr -> HoursBilled

1NF

1. All the fields in the given table contain only a single value. The table is in 1NF.

2NF

2. New tables are formed based on the given functional dependencies.

Project( ProjectNbr, ProjectName)

Employee( EmployeeNbr, EmployeeName)

Job( JobClass, HourlyRate)

ProjectBilling( ProjectNbr, EmployeeNbr, HoursBilled)

3. Every table is assigned a primary key which are as follows.

ProjectNbr is the primary key for Project table.

EmployeeNbr is the primary key for Project table.

JobClass is the primary key for Project table.

(ProjectNbr, EmployeeNbr) is the composite primary key for the ProjectBilling table.

4. The tables which are related to each other are linked via primary key and foreign key.

5. In the ProjectBilling table, the composite primary key, ProjectNbr, EmployeeNbr is composed of the primary keys of the Project and Employee tables, i.e., ProjectNbr and EmployeeNbr respectively.

6. Job table is related to Employee table. Hence, primary key of Job table, JobClass, is introduced as foreign key in Employee table.

Employee( EmployeeNbr, EmployeeName, JobClass)

7. Partial dependency arises when composite primary key exists and non-prime attributes (columns other than the primary key) depend on a part of the primary key, i.e., partial primary key.

In the ProjectBilling table, no partial dependency exists.

8. All the tables are in 2NF as given below.

Project( ProjectNbr, ProjectName)

Employee( EmployeeNbr, EmployeeName, JobClass)

Job( JobClass, HourlyRate)

ProjectBilling( ProjectNbr, EmployeeNbr, HoursBilled)

3NF

9. All the tables are in 2NF.

10. In every table, all non-prime attribute depend only on the primary key.

11. No transitive dependency exists, i.e., all non-prime attributes do not depend on other non-prime attributes.

12. Hence, all the conditions are satisfied and the tables are in 3NF.

"Dean wants a quick way to look up staff members by their Staff ID. In cell Q3, nest the existing VLOOKUP function in an IFERROR function. If the VLOOKUP function returns an error result, the text ""Invalid Staff ID"" should be displayed by the formula. (Hint: You can test that this formula is working by changing the value in cell Q2 to 0, but remember to set the value of cell Q2 back to 1036 when the testing is complete.)"

Answers

Answer:

ierror(VLOOKUP(Q2,CBFStaff[[Staff ID]:[Name]],2,FALSE), "Invalid Staff ID")

Explanation:

Let me try as much as I can to explain the concept or idea of iferror in vlookup.

iferror have a typically function and result like an if else statement, its syntax is IFERROR(value,value _ if _ error), this simply means that if the the error is equal to value, value is returned if not, the next argument is returned.

Having said that, feom the question we are given,

let's substitute the value with vlookup function and add an else argument, it will look exactly this way;

IFERROR(VLOOKUP(),"Invalid Staff ID")// now this will set the message if vlookup cannot find the.

On the other hand using the values given, we will have;

ierror(VLOOKUP(Q2,CBFStaff[[Staff ID]:[Name]],2,FALSE), "Invalid Staff ID")

Using the College Registration example from Section 6.7.3 as a starting point, do the following:
-Recode the logic sing CMP and conditional jump instructions (instead of the .IF and .ELSEIF directives).
-Perform range checking on the credits value; it cannot be less than 1 or greater than 30. If an invalid entry is discovered, display an appropriate error message.
-Prompt the user for the grade average and credits values.
Display a message that shows the outcome of the evaluation, such as "The student can register" or "The student cannot register".
6.7.3 example:
.data
TRUE = 1
FALSE = 0
gradeAverage WORD 275 ; test value
credits WORD 12 ; test value
OkToRegister BYTE ?
.code
main PROC
mov OkToRegister,FALSE
.IF gradeAverage > 350
mov OkToRegister,TRUE
.ELSEIF (gradeAverage > 250) && (credits <= 16)
mov OkToRegister,TRUE
.ELSEIF (credits <= 12)
mov OkToRegister,TRUE
.ENDIF

Answers

Answer:

Check the explanation

Explanation:

INCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

In devising a route to get water from a local lake to its central water storage tank, the city of Rocky Mount considered the various routes and capacities that might be taken between the lake and the storage tank. The city council members want to use a network model to determine if the city's pipe system has enough capacity to handle the demand.
1. They should use ____________.
A. Minimal Spanning Tree Method
B. Shortest Path Method
C. Maximal Flow Method
D. Any of the above will do

Answers

Answer:

C. Maximal Flow Method

Explanation:

When it comes to optimization theory, Maximal Flow Method or problems have to do with finding a possible or viable flow through a flow network that obtains the maximum potential flow rate. The maximum flow problem can be viewed as an exceptional case of more complex and complicated network flow problems, such as that of the circulation problem.

Answer each of the following with a TRUE (T) or FALSE (F).
(1) Pipelining allows instructions to execute sequentially.
(2) If you can find the value x in the cache, you can also find it in the main memory too.
(3) Only the lw instruction can access the Data Memory component.
(4) The bias in single precision is 127, while in double precision it is 1024.
(5) In a cache mapping architecture, the valid bit is always on until data is found in that specific block.
(6) Memory speed generally gets faster the farther you move from the processor.
(7) A cache is a small high speed memory that stores a subset of the information that is in RAM.
(8) The hit rate of a cache mapping architecture is calculated by doing 1 - hit penalty.
(9) Cache is the fastest type of memory.
(10) Single-cycle and multi-cycle machines differ in CPI but all the other values are the same.

Answers

Answer:

t

Explanation:

Ronaldo wants to determine if employees would prefer having bagels or
donuts at morning meetings. Which method would be best to collect this
information?

Answers

Answer:

surveys and questionnaires

Answer:

Survey

Explanation:

You have been allocated a class C network address of 211.1.1.0 and are using the default subnet mask of 255.255.255.0 how many hosts can you have?

Answers

Answer:thats is so easy obviously 69

Explanation:

Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}.

import java.util.Scanner; public class StudentScores { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); final int NUM_POINTS = 4; int[] dataPoints = new int[NUM_POINTS]; int controlValue; int i; controlValue = scnr.nextInt(); for (i = 0; i < dataPoints.length; ++i) { dataPoints[i] = scnr.nextInt(); } for (i = 0; i < dataPoints.length; ++i) { System.out.print(dataPoints[i] + " "); } System.out.println(); } }

Answers

Answer:

import java.util.Scanner;

public class StudentScores

{

public static void main(String[] args) {

 Scanner scnr = new Scanner(System.in);

 final int NUM_POINTS = 4;

 int[] dataPoints = new int[NUM_POINTS];

 int controlValue;

 int i;

 controlValue = scnr.nextInt();

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

     dataPoints[i] = scnr.nextInt();

 }

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

     System.out.print(dataPoints[i] + " ");

 }

 System.out.println();

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

     if(dataPoints[i] < controlValue){

         dataPoints[i] = dataPoints[i] * 2;          

     }

     System.out.print(dataPoints[i] + " ");

 }

}

}

Explanation:

*Added parts highligted.

After getting the control value and values for the array, you printed them.

Create a for loop that iterates through the dataPoints. Inside the loop, check if a value in dataPoints is smaller than the contorolValue. If it is, multiply that value with 2 and assign it to the dataPoints array. Print the elements of the dataPoints

Answer:

import java.util.Scanner;

public class numm3 {

   public static void main (String [] args) {

       Scanner scnr = new Scanner(System.in);

       final int NUM_POINTS = 4;

       int[] dataPoints = new int[NUM_POINTS];

       int controlValue;

       int i;

       System.out.println("Enter the control Variable");

       controlValue = scnr.nextInt();

       System.out.println("enter elements for the array");

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

           dataPoints[i] = scnr.nextInt();

       }

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

           System.out.print(dataPoints[i] + " ");

       }

       System.out.println();

       //Doubling elements Less than Control Variable

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

           if (dataPoints[i]<controlValue){

               dataPoints[i] = dataPoints[i]*2;

           }

           System.out.print(dataPoints[i] + " ");

       }

       System.out.println(); } }

Explanation:

See the additional code to accomplish the task in bold

The trick is using an if statement inside of a for loop that checks the condition (dataPoints[i]<controlValue) If true, it multiplies the element by 2

Identify the flaws / limitations in the following ConvertToNumber method:


public static bool ConvertToNumber(string str)
{
bool canConvert = false;
try
{
int n = Int16.Parse(str);

if (n != 0)
{
canConvert = true;
}
}
catch (Exception ex)
{

}
bool retval = false;
if (canConvert == true)
{
retval = true;
}
return retval;
}

Answers

Answer:

Flaws and limitations identified in this program includes;

1.There was a not necessary usage of variable retrieval. Would have made use of canConvert.

2. Looking at the program, one will notice numerous typos. One of which is the fact that in JAVA we make use of Boolean instead of bool.

3.We rather use Integer.parseInt in JAVA and not Int16, cant make use of Int16.

4. The exception cant be printed

5. JAVA makes use of checkConversion instead of convertNumber as used in the program.

6. It cant work for decimal numbers, 0 and big integers.

Explanation:

See Answer for the detailed explaination of the flaws and limitations identified in the program.

What keyboard functions lets you delete words

Answers

Answer:Backspace

Explanation:

If you want to delete words you use the backspace button.

Answer:

Backspace

Explanation:

Let a and b be two vector. i.e. a and b are two vectors, of possibly different sizes, containing integers. Further assume that in both a and b the integers are sorted in ascending order.
1. Write a function:
vector merge( vector a, vector b)
that will merge the two vectors into one new one and return the merged vector.
By merge we mean that the resulting vector should have all the elements from a and b, and all its elements should be in ascending order.
For example:
a: 2,4,6,8
b: 1,3,7,10,13
the merge will be: 1,2,3,4,6,7,8,10,13
Do this in two ways. In way 1 you cannot use any sorting function. In way 2 you must.

Answers

Answer:

A  C++ program was used in writing a function in merging ( vector a, vector b)   or that will merge the two vectors into one new one and return the merged vector.

Explanation:

Solution

THE CODE:

#include <iostream>

#include <vector>

using namespace std;

vector<int> merge(vector<int> a, vector<int> b) {

   vector<int> vec;

   int i = 0, j = 0;

   while(i < a.size() || j < b.size()) {

       if(i >= a.size() || (j < b.size() && b[j] < a[i])) {

           if(vec.empty() || vec[vec.size()-1] != b[j])

               vec.push_back(b[j]);

           j++;

       } else {

           if(vec.empty() || vec[vec.size()-1] != a[i])

               vec.push_back(a[i]);

           i++;

       }

   }

   return vec;

}

int main() {

   vector<int> v1 = {2, 4, 6, 8};

   vector<int> v2 = {1, 3, 7, 10, 13};

   vector<int> vec = merge(v1, v2);

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

       cout << vec[i] << " ";

   }

   cout << endl;

   return 0;

}

Write a C++ program that opens and reads file question2.txt. File question1.txt has 3 students and 3 grades of each. You program should read values from file and assign values to 4 variables: (string) name, (double) grade1, (double) grade2, (double) grade3. Then, it should calculate the average grade of each student with the precision of 2 (use setprecision(n) function from header file) and find maximum and minimum grade in the class. Finally, you should have a report on both: • console screen • Output file named output2.txt in the following output format: Max Grade max Min Grade min Adam ave_grade John ave_grade Bill ave_grade

Answers

Answer:

see explaination

Explanation:

#include <fstream>

#include <iostream>

#include <string>

//to set precision

#include <iomanip>

#include <bits/stdc++.h>

//structure of student is created.

struct Student

{

std::string name;

double grade1;

double grade2;

double grade3;

double Average;

// Constructor initializes semester scores to 0.

Student()

{

grade1 = 0;

grade2 = 0;

grade3 = 0;

Average = 0;

}

//Read from the file and calculate the average, min and max grade with name.

void read(std::fstream& fil)

{

std::string temp;

fil >> name;

fil >> temp;

grade1 = std::stod(temp);

fil >> temp;

grade2 = std::stod(temp);

fil >> temp;

grade3 = std::stod(temp);

Average = ((grade1 + grade2 + grade3) /3.0);

}

//write to file- name and average with precision 2.

void write(std::fstream& fil)

{

fil << name << " " << std::setprecision(2) << std::fixed << Average << std::endl;

}

//Logic to calculate the minimum grade of the class.

double min()

{

double min = grade1;

if(min > grade2)

{

min = grade2;

}

if(min > grade3)

{

min = grade3;

}

return min;

}

//Logic to calculate the maximum grade of the class.

double max()

{

double max = grade1;

if(max < grade2)

{

max = grade2;

}

if(max < grade3)

{

max = grade3;

}

return max;

}

//Print the name and average with precision 2 in the console.

void print()

{

std::cout << name << " " ;

std::cout << std::setprecision(2) << std::fixed << Average << std::endl;

}

};

//As per this question,students are set to 3.

Student students[3];

//main method.

int main()

{

// Read from the file question2.txt

std::fstream fil;

fil.open("question2.txt", std::ios::in);

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

students[i].read(fil);

fil.close();

// finding the max grade of the class.

int max = students[0].max();

int temp = students[1].max();

if(max <temp)

max = temp;

temp = students[2].max();

if(max < temp)

max = temp;

// finding the min grade of the class.

int min = students[0].min();

temp = students[1].min();

if(min > temp)

min = temp;

temp = students[2].min();

if(min > temp)

min = temp;

// print the output in console.

std::cout << "Max Grade " << max << std::endl;

std::cout << "Min Grade " << min << std::endl;

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

students[i].print();

// write to output file output2.txt .

fil.open("output2.txt", std::ios::out);

fil << "Max Grade " << max << std::endl;

fil << "Min Grade " << min << std::endl;

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

students[i].write(fil);

fil.close();

return 0;

}

AYUDAAAA!!!!! URGENTE!!!!!!1
¿para que sirve la "BIG DATA"?

Answers

Answer:

Big data is a field that treats ways to analyze, systematically extract information from, or otherwise deal with data sets that are too large or complex to be dealt with by traditional data-processing application software. ... Big data was originally associated with three key concepts: volume, variety, and velocity.

SPANISH TRANSLATION

Big data es un campo que trata formas de analizar, extraer sistemáticamente información de, o de otra manera tratar con conjuntos de datos que son demasiado grandes o complejos para ser manejados por el software tradicional de aplicación de procesamiento de datos. ... Big data se asoció originalmente con tres conceptos clave: volumen, variedad y velocidad.

Write a program that will ask for the user to input a filename of a text file that contains an unknown number of integers. And also an output filename to display results. You will read all of the integers from the input file, and store them in an array. (You may need to read all the values in the file once just to get the total count) Using this array you will find the max number, min number, average value, and standard deviation. These results will be reported to both the screen and placed into the output file that the user choose. Output to screen and file could look like this: Read from file: 12 values Maximum value

Answers

Answer: Provided in the explanation section

Explanation:

Code provided below in a well arranged format

inputNos.txt

70

95

62

88

90

85

75

79

50

80

82

88

81

93

75

78

62

55

89

94

73

82

___________________

StandardDev.java

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class StandardDev {

public static void main(String[] args) {

//Declaring variables

String filename;

int count = 0, i = 0;

Scanner sc1 = null;

int min, max;

double mean, stdDev;

int nos[] = null;

/*

* Creating an Scanner class object which is used to get the inputs

* entered by the user

*/

Scanner sc = new Scanner(System.in);

//Getting the input entered by the user

System.out.print("Enter the name of the filename :");

filename = sc.next();

try {

//Opening the file

sc1 = new Scanner(new File(filename));

//counting no of numbers in the file

while (sc1.hasNext()) {

sc1.nextInt();

count++;

}

sc1.close();

sc1 = new Scanner(new File(filename));

//Creating an Integer based on the Count

nos = new int[count];

//Populating the values into an array

while (sc1.hasNext()) {

nos[i] = sc1.nextInt();

i++;

}

sc1.close();

//calling the methods

min = findMinimum(nos);

max = findMaximum(nos);

mean = calMean(nos);

stdDev = calStandardDev(nos, mean);

//Displaying the output

System.out.println("Read from file :" + count + " values");

System.out.println("The Minimum Number is :" + min);

System.out.println("The Maximum Number is :" + max);

System.out.printf("The Mean is :%.2f\n", mean);

System.out.printf("The Standard Deviation is :%.2f\n", stdDev);

} catch (FileNotFoundException e) {

e.printStackTrace();

}

}

//This method will calculate the standard deviation

private static double calStandardDev(int[] nos, double mean) {

//Declaring local variables

double standard_deviation = 0.0, variance = 0.0, sum_of_squares = 0.0;

/* This loop Calculating the sum of

* square of eeach element in the array

*/

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

/* Calculating the sum of square of

* each element in the array    

*/

sum_of_squares += Math.pow((nos[i] - mean), 2);

}

//calculating the variance of an array

variance = ((double) sum_of_squares / (nos.length - 1));

//calculating the standard deviation of an array

standard_deviation = Math.sqrt(variance);

return standard_deviation;

}

//This method will calculate the mean

private static double calMean(int[] nos) {

double mean = 0.0, tot = 0.0;

// This for loop will find the minimum and maximum of an array

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

// Calculating the sum of all the elements in the array

tot += nos[i];

}

mean = tot / nos.length;

return mean;

}

//This method will find the Minimum element in the array

private static int findMinimum(int[] nos) {

int min = nos[0];

// This for loop will find the minimum and maximum of an array

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

// Finding minimum element

if (nos[i] < min)

min = nos[i];

}

return min;

}

//This method will find the Maximum element in the array

private static int findMaximum(int[] nos) {

int max = nos[0];

// This for loop will find the minimum and maximum of an array

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

// Finding minimum element

if (nos[i] > max)

max = nos[i];

}

return max;

}

}

_____________________

Output:

Enter the name of the filename :inputNos.txt

Read from file :22 values

The Minimum Number is :50

The Maximum Number is :95

The Mean is :78.45

The Standard Deviation is :12.45

cheers i hope this helped !!!

Suppose the daytime processing load consists of 65% CPU activity and 35% disk activity. Your customers are complaining that the system is slow. After doing some research, you learn that you can upgrade your disks for $8,000 to make them 3 times as fast as they are currently. You have also learned that you can upgrade your CPU to make it 1.5 times faster for $6,000. a) Which would you choose to yield the best performance improvement for the least
amount of money?
b) Which option would you choose if you don’t care about the money, but want a
faster system?
c) What is the break-even point for the upgrades? That is, what price would be
charged for the CPU(or the disk--change only one) so the results was the same cost per 1% increase in both.

Answers

Answer:

The answer to this question can be described as follows:

Explanation:

Given data:

Performance of the CPU:  

The Fastest Factor Fraction of Work:

[tex]f_1=65 \% \\\\=\frac{65}{100} \\\\ =0.65[/tex]

Current Feature Speedup:

[tex]K_1=[/tex] 1.5

CPU upgrade=6000

Disk activity:

The quickest part is the proportion of the work performed:

Current Feature Speedup:

[tex]k_2=3[/tex]

Disk upgrade=8000

System speedup formula:

[tex]s=\frac{1}{(1-f)+(\frac{f}{k})}[/tex]

Finding the CPU activity and disk activity by above formula:

CPU activity:

[tex]S_{CPU}=\frac{1}{(1-f_1)+(\frac{f_1}{k_1})} \\\\=\frac{1}{(1-0.65)+(\frac{0.65}{1.5})} \\\\=1.276 \% ...\rightarrow (1) \\[/tex]

Disk activity:

[tex]S_{DISK} = (\frac{1}{(1-f_2)+\frac{f_2}{k_2}}) \\\\ S_{DISK} = (\frac{1}{(1-0.35)+\frac{0.35}{3}}) \\\\ = -0.5\% .... \rightarrow (2)[/tex]

CPU:

Formula for CPU upgrade:

[tex]= \frac{CPU \ upgrade}{S_{CPU}}\\\\= \frac{\$ 6,000}{1.276}\\\\= 4702.19....(3)[/tex]

DISK:

Formula for DISK upgrade:

[tex]=\frac{Disk upgrade} {S_{DISK}}\\\\= \frac{\$ 8000}{-0.5 \% }\\\\= - 16000....(4)[/tex]

equation (3) and (4),

Thus, for the least money the CPU alternative is the best performance upgrade.

b)

From (3) and (4) result,

The disc choice is therefore the best choice for a quicker system if you ever don't care about the cost.

c)

The break-event point for the upgrades:

=4702.19 x-0.5

= -2351.095

From (2) and (3))

Therefore, when you pay the sum for disc upgrades, all is equal $ -2351.095

Why is it important to use correct syntax?

ANSWER: D) to ensure the programs run properly and return expected results

Answers

Answer: True

Explanation:

Answer:

D

Explanation:

If your options are

a) to demonstrate a sophisticated programming style

b) to demonstrate a flexible programming style

c)to ensure that programs will work on any computer platform

d) to ensure that programs run properly and return expected results

Then yes this is very much correct!

What happens in the process represented by the flowchart ?

A) The person drinks water if the answer to “Thirsty?” is no.
B) The person always drinks water.
C) The person drinks water if the answer to “Thirsty?” is yes.
D) The person never drinks water.

CORRECT ANSWER: C!!!

Answers

Answer:

the person drinks water if the answer to “thirsty?” is yes

Answer:

C

Explanation:

Other Questions
week. After 5 weeks the account holds $170. Write an equation that represents the amount y(in dollars) of money in the account after x weeks. Which peninsula is circled in red on the map above?A.the Indian PeninsulaB.the Korean PeninsulaC.the Malay PeninsulaD.the Kamchatka Peninsula Dr. Gonzalez is considering joining the Garden Club. If he pays a $25 membership fee, hecan buy rosebushes from the club at a reduced price of $10 each. If he does not join theclub, he can buy rosebushes from a local nursery for $15 each. The graph below comparesthe cost of buying rosebushes from the Garden Club and from the local nursery. Which structures in humans serve the same function as the vascular system in plants?aarteries and veins bmuscles and bones cstomach and intestines dbrain and spinal cord The golden brooch my mother woreShe left behind for me to wear;I have no thing I treasure more:Yet, it is something I could spare.Which kind of meter is used in this stanza?trochaic dimeteriambic pentameteriambic tetrameteriambic monometer (help) When a radius intersects a chord of a circle at a right angle, what conclusion can be made? The radius is bisected. The chord is bisected. The radius and the chord are congruent. The radius is twice as long as the chord. Determine whether the set of vectors is orthonormal. If the set is only orthogonal, normalize the vectors to produce an orthonormal set.Bold u 1 equals [Start 3 By 1 Matrix 1st Row 1st Column one third 2nd Row 1st Column one third 3rd Row 1st Column one third EndMatrix ]and Bold u 2 equals [Start 3 By 1 Matrix 1st Row 1st Column negative one half 2nd Row 1st Column 0 Subscript font size decreased by 6 Superscript font size decreased by 6 3rd Row 1st Column one half EndMatrix ] Mr. Capulet's comment "My will to her consent is but a part" (1.2.17) highlights which apparent trait:A.Mr. Capulet's desire for what Juliet wants, based on his love of his only daughterB. Mr. Capulet's consistency in following guidelines and customs for parenting a "maide"C. Mr. Capulet's deceitful nature; most of his words are lies and untruthsD. Mr. Capulet's desire for status, wealth, and power: connections to Escalus he will gain by this arrangementE. Mr. Capulets quick temper, which flares later in the play Why do third parties last longer than the other two kinds of parties Compltez les verbes suivants avec la bonne terminaison au prsent delindicatif :A Tu mang.................. une orange. H Nous arriv... Paris.B Vous rv.... la nuit. I Je cuisin... pour mes amis.C ll chant.. sous la pluie. J Je pratiqu... le karat.D Nous jardin.. dans la cour. K Elles jou du piano.E IIs accus le voisin. L On aim. la glace au chocolat.F Je parl.. avec mon camarade.G Le chien attaqu. le facteur.M Sarah detest. le vent.N Je souffl... mes bougies. A.) 4.7 feetB.) 6.5 feetC.) 30.7 feetD.) 5.5 feetE.) 22.3 feetThe roller coaster cars are designed as shown, with a yellow racing stripe along the diagonal of the parallelogram face. Determine the length of the racing stripe. Consider the figure shown on the coordinate plane. What are the coordinates of the midpoint of line segment CB?A)(0, 3/2)B)(1, 0)C)(3/2,0)D)(2, 1) "What would you do or how would you feel if the person you loved and were married to killed a member of your family?". What would you do if you were in Juliet's shoes? Would you abandon the love of your life, or would you forgive them wholeheartedly Anyone, please help me answer this question. Hi!Got a question!Rectangular container holds 70 litres of water when full. Its height is 70 cm.What is its base area?Thanks!!And please explain! 25 PtsWhat type of graph would you use to compare the prices of Felix's books and of Tyler's books? In two or more sentences, explain your choice.bar graphline graphscatter plothistogrambox-and-whisker plotFelix's booksMean 10.21Median 6Mode 3Range 26Tyler's BooksMean 77.36Median 68Mode 76Range 92 Air pollution resulting from the combination of gases produced by burning fossil fuels is called __________.A) acid rainB) smogC) chimney effectD) environmental tobacco smokeE) weathering 2 cars departed the same place at the sametime. They traveled the same direction. Onetraveled 50 mph for 4 hours. The other cartraveled 60 mph for 8 hours. How many milesfarther did the 2nd car travel? Businesses, individuals, and governments often need to raise capital, while others have surplus funds. In a well-functioning economy, capital flows efficiently from those with surplus capital to those who need it. Transfers can take place in 3 ways (indirect, direct) transfers without going through any type of financial institution, (indirect, direct) transfers through investment banks that underwrite the securities, and indirect transfers through financial (agencies, intermediaries, funds) that create new forms of capital. What is the volume of this rectangular prism?