You may want to block a specific email address or server to prevent people or companies from sending you messages you do not want to receive.
What is Email address?A computer network's electronic mailbox, often known as an email address, is used to send and receive messages. All email addresses have the same format.
To create a personal email address that will not change as you change schools, jobs, or internet service providers, create an account with an email provider of your choosing.
Typically, users will use their name in the email address, so the mail will be easily recognizable. Create a password in order to securely access your emails, and you’re set.
Therefore, You may want to block a specific email address or server to prevent people or companies from sending you messages you do not want to receive.
To learn more about Email, refer to the link:
https://brainly.com/question/14666241
#SPJ1
Please help me understand what I'm doing wrong in my python code, its returning a [] in the written file.
# You work at a low latency trading firm and are asked to deliver the order book data provided in order_book_data.txt to a superior
# The problem is that the data isn't formatted correctly. Please complete the following steps to apropriately format the data
# Notice, the first column is a ticker, the second column is a date, the third column is a Bid, the fourth column is an Ask, and the fifth column is a currency type
# 1. Open order_book_data.txt
# 2. Remove the order book lines. i.e. ***** Order Book: ###### *****
# 3. Get rid empty lines
# 4. Get rid of spaces
# 5. Notice that there are two currencies in the order book; USD and YEN. Please convert both the Bid and Ask price to USD (if not already)
# The Bid and Ask are the 3rd and 4th column, respectively
# 6. Create a header line Ticker, Date, Bid, Ask
# 7. Save the header line and propely formatted lines to a comma seperated value file called mktDataFormat.csv
Answer:
There are several issues with the code that could be causing it to return an empty file.
Indentation errors: Python relies on indentation to indicate blocks of code, so it's important to make sure that the code is indented correctly. In your code, the if statement and columnA = float(columnA) line are not indented properly.Missing append statement: After converting the Bid and Ask prices to USD, the code is not actually adding them to the data list.Writing the wrong variable: In the last line of the code, you are writing the entire data list as a string, instead of iterating through the list and writing each element as a string.Explanation:
file = open("order_book_data.txt", "r")
data = []
lines = file.readlines()
for line in lines:
if line.strip() == '':
continue
if ("***" in line):
continue
column = line.strip().split(",")
columnA = float(column[2])
columnB = float(column[3])
if column[4] == "YEN":
columnA = columnA * 0.0075
columnB = columnB * 0.0075
column[2] = str(columnA)
column[3] = str(columnB)
data.append(",".join(column))
header = "Ticker,Date,Bid,Ask\n"
file.close()
file2 = open("mktlinesFormat.csv", "w")
file2.write(header)
for line in data:
file2.write(line + "\n")
file2.close()
In this code, i use continue statements to skip over the order book lines and empty lines. then i split each line into a list of columns, convert the Bid and Ask prices to USD if necessary, and join the columns back into a comma-separated string. then append the formatted string to the data list.
After processing all the lines, i write the header line and each formatted line to a new file, one line at a time. Note that add a newline character \n to the end of each line to ensure that each line is written on a separate line in the file.
given the hexadecimal representation of a floating-point number as 0x8ff0c000, find the equivalent decimal value of the number.
Where the hexadecimal representation of a floating-point number as 0x8ff0c000 is given, the equivalent decimal value of the number is: -7.834372 x 10^25.
What is the rationale for the above response?To convert a hexadecimal representation of a floating-point number to decimal, we need to first separate the bits into their respective parts: sign bit, exponent bits, and mantissa bits. For a single-precision floating-point number in IEEE 754 format, the layout is as follows:
1 bit for sign
8 bits for exponent
23 bits for mantissa
The given hexadecimal representation of the floating-point number is 0x8ff0c000. In binary, this is:
10001111111100001100000000000000
The leftmost bit is the sign bit, which is 1, indicating a negative number.
The next 8 bits are the exponent bits, which are 00011111 in binary. To get the actual exponent, we need to subtract the bias, which is 127. So the exponent is:
00011111 - 127 = -96
The remaining 23 bits are the mantissa bits. To convert these to decimals, we first add an implicit leading 1 to the front of the mantissa. So the mantissa is:
1.10001100000000000000000
To get the decimal value of the mantissa, we need to add up the values of each bit, weighted by their position. The first bit after the decimal point has a value of 1/2, the next bit has a value of 1/4, and so on, with each subsequent bit having half the value of the previous bit.
So the decimal value of the mantissa is: -7.834372 x 10^25.
Learn more about hexadecimal at:
https://brainly.com/question/13041189
#SPJ1
Daniel wants to buy a computer to use for playing games after work. He loves racing games and wants to make sure his device has all the specifications needed to run them smoothly and efficiently. Which of these factors should he consider?
A. Form factor – some games do not run on laptops
B. Processor core – some applications, especially games, have greater processor requirements
C. Size – larger desktops provide more physical space for memory storage, increasing efficiency
D. External hard disk capacity – provides additional temporary storage needed to run heavy applications
Games require a significant amount of computing power, making processor core an essential for effective operation. A computer with a quick CPU and several cores, such as an Intel Core i5 or i7 or an AMD.
What kinds of gadgets can you connect to a computer without having to manually install device drivers for them first?Plug-and-play devices include displays, mouse, and keyboards. Often, plug-and-play device drivers are general and do not need to be manually installed.
What is the name of the system software that allows an operating system and a device to communicate?Operating systems and other computer programmes can access hardware operations without using a driver because drivers provide a software interface to hardware components.
To know more about processor visit:-
https://brainly.com/question/28902482
#SPJ1
You are in the process of installing a new motherboard in your workstation.
You have already installed the CPU, heat sink, and memory. You have inserted the I/O shield into the case, fastened the standoffs to the case, and attached the motherboard to the standoffs. You are now ready to complete the installation. What is the BEST next step to complete?
answer choices
Connect your drives to the SATA connectors.
Install additional devices in the expansion slots.
Connect the power and accessory cables.
Document the settings of the new motherboard.
The BEST next step to complete would be to connect the power and accessory cables.
How can you do this?This includes plugging in the power supply cables, such as the 24-pin ATX power connector and any additional 4 or 8-pin CPU power connectors.
Additionally, any necessary accessory cables such as USB, front panel, and audio connectors should be connected to their respective headers on the motherboard.
Once the power and accessory cables are connected, you can then proceed with installing the operating system and configuring the BIOS settings.
Read more about motherboards here:
https://brainly.com/question/27851911
#SPJ1
ycling electronics, you can help
that apply.
A. distribute TVs or
monitors
C. keep toxic materials
out of the water we
drink
Sele
B. reuse valuable
materials
D. preserve limitec
resources
Note that recycling electronics reuses materials, preserves limited resources, distributes functional devices, & keeps toxic materials out of the environment.
What is the rationale for the above response?A) Distributing TVs or monitors: While recycling electronics helps to recover valuable materials, it is also important to ensure that any devices that are still functional are reused.
b) Reusing valuable materials: Recycling electronics can help recover valuable materials like gold, silver, copper, and other metals. These materials can then be reused to manufacture new products, reducing the need for mining and extraction of raw materials.
c) Keeping toxic materials out of the water we drink: Electronic devices often contain hazardous materials such as lead, mercury, and cadmium. If not disposed of properly, these materials can leach into the soil and water, contaminating the environment and potentially harming human health.
d) Preserving limited resources: Electronic devices contain a wide range of materials, many of which are non-renewable resources. By recycling electronics, these materials can be conserved and reused, reducing the strain on the limited natural resources we have.
Learn more about recycling:
https://brainly.com/question/30283693
#SPJ1
A city gets its electricity from a dam, where water is stored in a reservoir. How does the water provide the city with its power?.
The water in the reservoir of a dam is used to generate hydroelectric power, which is a form of renewable energy. When water is released from the reservoir, it flows through large pipes called penstocks and enters a turbine. The force of the water turns the blades of the turbine, which rotates a generator and produces electricity.
What is the electricity about?The amount of electricity produced by the dam depends on several factors, including the amount of water flowing through the penstocks, the size of the turbine and generator, and the height of the dam.
The generated electricity is then transmitted through power lines to a substation, where the voltage is transformed to a level suitable for distribution to homes and businesses in the city.
In summary, the water in the reservoir of a dam provides the city with its power by turning a turbine and generating electricity through the use of hydroelectric power.
Learn more about electricity from
https://brainly.com/question/29241794
#SPJ1
question 7: karan is an incident handler at a financial institution. his steps in a recent incident are not up to the standards of the company. karan frequently forgets some steps and procedures while handling responses as they are very stressful to perform. which of the following actions should karan take to overcome this problem with the least administrative effort?
Karan can compile a list of the steps and practises that must be followed when handling an event. To make sure he doesn't miss any important steps during the response process, he can consult the checklist.
The initial stage in the incident response procedure is which of the following?There are various stages in the incident response process. In the first stage, an incident response team must be formed, trained, and equipped with the appropriate materials.
What is a system for incident management's five primary elements?Preparedness, Communications and Information Management, Resource Management, Command and Management, and Ongoing Management and Maintenance are the five NIMS Components as described by NIMS 2008.
To know more about checklist visit:-
https://brainly.com/question/29834202
#SPJ1
What benefits or risks are associated with businesses adopting new internet enabled devices
E-commerce between businesses is B2B. E-commerce between businesses and consumers is called B2C. What are some examples of each? How do you think each entity (business, consumer) benefits from e-commerce? Bricks and clicks is a business model that incorporates both a physical presence and an online presence. Give some examples of businesses that follow the bricks and clicks model. Are there any businesses that have only an online presence?
Examples of B2B commerce may typically include the manufacturing of materials, clothing, car parts, and semiconductors. While examples of B2C commerce may include selling products directly to a consumer at home online. It includes Amazon, Flipkart, Walmart, etc.
What are the benefits of B2B and B2C commerce?An effective benefit of B2B e-commerce may include a digital experience platform that will enable your organization to expand and scale easily to meet market demand and customer needs, by opening new sales channels and continuously reaching new market segments.
The benefits of B2C commerce may typically include low cost, globalization, personalization, quality effectiveness, booming businesses, etc. Business to Consumer (B2C) is a business model in which businesses sell their products and services to customers.
Therefore, the examples of each commerce are well described above along with its benefits.
To learn more about E-commerce, refer to the link:
https://brainly.com/question/13165862
#SPJ1
the left column below gives a proof that the product of two odd integers is odd. match the steps of the proof on the left with the justifications for those steps on the right. 1. let a and b be any two odd integers. (we wish to show that ab is also an odd integer.) 1. let a and b be any two odd integers. (we wish to show that ab is also an odd integer.) drop zone empty. 2. there are two integers m and n such that a
An odd integer can be expressed in the form 2m + 1 for some integer m according to the definition of an odd integer. We must demonstrate that ab may be expressed in the form 2k + 1 for some integer k
How can the oddness of the product of two odd numbers be established?An odd number is the result of two odd numbers. Let the integers m and k vary. As a result, the numbers 2m+1 and 2k+1 are odd. An odd number, 2 (2mk + m + k) + 1, is obtained.
For two integers m and n, a = 2m + 1 and b = 2n + 1, respectively. (According to what an odd integer is)
4mn + 2m + 2n + 1 is equal to ab = (2m + 1)(2n + 1). (Product expansion)
ab equals (2mn + m + n) + 1. (Factoring out a 2)
Ab is an odd integer since 2mn + m + n is an integer. (According to what an odd integer is)
To know more about integer visit:-
https://brainly.com/question/15276410
#SPJ1
when a sql statement consists of two queries and you place one query inside another, the inner query becomes a(n) .
A subquery is a query that is nested inside of a select, insert, update, delete, or subquery.
A nested SQL query is what?A subquery, inner query, or nested query is a SQL query that is placed within the WHERE clause of another SQL query. Data that will be used in the main query as a condition to further limit the data that can be retrieved is returned by a subquery.
Is it feasible to nest questions inside of one another?A query nested inside another query is known as a subquery. It can be inserted into a query at any point, including inside another subquery. The syntax is really straightforward; you simply enclose your subquery in parentheses and enter it into the main query.
To know more about subquery visit:-
https://brainly.com/question/14079843
#SPJ1
implement a linear search typing program. repeatedly ask the user what letter they are thinking until you get the right one. stop when the user types the exclamation point. submit the code in the file main.c. you may supply additional files if you wish to. you main program must be in main.c. assumption: you may assume that the user will only type: y, y, n, or n. the user will only enter exactly 1 character and will not enter any other characters. you do not have to provide any error checking on this input. remember we are simulating a person who can only give us yes/no answers. assumption: you may assume the user will never type more than 100 characters before entering '!'. example execution trace: are you thinking of the letter ' '? n are you thinking of the letter '!'? n are you thinking of the letter '.'? n are you thinking of the letter 'a'? n are you thinking of the letter 'b'? n are you thinking of the letter 'c'? y are you thinking of the letter ' '? n are you thinking of the letter '!'? n are you thinking of the letter '.'? n are you thinking of the letter 'a'? y are you thinking of the letter ' '? n are you thinking of the letter '!'? n are you thinking of the letter '.'? n are you thinking of the letter 'a'? n are you thinking of the letter 'b'? n are you thinking of the letter 'c'? n are you thinking of the letter 'd'? n are you thinking of the letter 'e'? n are you thinking of the letter 'f'? n are you thinking of the letter 'g'? n are you thinking of the letter 'h'? n are you thinking of the letter 'i'? n are you thinking of the letter 'j'? n are you thinking of the letter 'k'? n are you thinking of the letter 'l'? n are you thinking of the letter 'm'? n are you thinking of the letter 'n'? n are you thinking of the letter 'o'? n are you thinking of the letter 'p'? n ar
The program to implement a linear search typing program is in the explanation part.
What is programming?Computer programming is the process of writing code that instructs a computer, application, or software program on how to perform specific actions.
Here's the implementation of the linear search typing program in C:
#include <stdio.h>
int main() {
char letter;
int count = 0;
while (1) {
printf("Are you thinking of the letter '%c'? ", 'a' + count);
scanf(" %c", &letter);
if (letter == '!') {
break;
}
if (letter == 'y') {
printf("Great! You were thinking of the letter '%c'.\n", 'a' + count);
break;
}
count++;
}
return 0;
}
Thus, in this program, we use a while loop to repeatedly ask the user whether they are thinking of a certain letter.
For more details regarding programming, visit:
https://brainly.com/question/11023419
#SPJ1
reluctant to adopt ai for her business because her employees might worry about their job security. which of the following statements is a truthful explanation about how ai benefits businesses?
AI can help businesses become more efficient and productive by automating tedious, repetitive tasks and freeing up human workers to focus on more creative and strategic tasks.
What is the tedious?The meanings of words frequently shift, and occasionally they can signify practically the exact opposite of what they originally meant (such as nice, which in its earliest use meant "lewd, wanton, dissolute"). Tedious is not one of those words; while their connotations have changed over time, they have always involved annoying, dull, or protracted activities. The Latin root taedre, which means "to disgust or weary," is where the name derives from. Since the 15th century, the word tedious has been used and is listed in hundreds of dictionaries. Yet, probably none have provided a definition as poetic and brief as Nathaniel Bailey's entry in his 1756 New Universal Etymological English Dictionary: "Wearisome through continuance."
To learn more about tedious
https://brainly.com/question/29105619
#SPJ1
write a denotational semantics mapping function for the following statements: 1. ada for2. java do-while 3. java boolean expressions 4. java for 5. c switch
Denotational semantics mapping function for the given statement is in the explanation part.
What is denotational semantics?Denotational semantics is a method used in computer science to formalize the meanings of programming languages by creating mathematical objects (referred to as denotations) that represent the meanings of language expressions.
Denotational semantics mapping function for the following statements:
A. Ada for
Mpf(for var in init_expr .. final_expr loop L end loop, s)
if VARMAP(i, s) = undef for var or some i in init_expr or final_expr
then error
else if Me(init_expr, s) > Me(final_expr, s)
then s
else Ml(while init_expr - 1 <= final_expr do L, Ma(var := init_expr + 1, s))
B. Java do-while
Mr(repeat L until B)if Mb(B, s) = undef
then error
else if Msl(L, s) = error
then error
else if Mb(B, s) = true
then Msl(L, s)
else Mr(repeat L until B), Msl(L, s))
C. Java Boolean expressions
Mb(B, s) if VARMAP(i, s) = undef
for some i in B
then error
else B', where B' is the result ofevaluating B after setting eachvariable i in B to VARMAP(i, s)
D. Java
forMcf(for (expr1; expr2; expr3) L, s)if VARMAP (i, s) = undef
for some i in expr1, expr2, expr3, or L
then error
else if Me(expr2, Me (expr1, s)) = 0
then s
else Mhelp(expr2, expr3, L, s)Mhelp(expr2, expr3, L, s)
if VARMAP (i, s) = undef
for some i in expr2, expr3, or L
then error
elseif Msl(L, s) = error
E. C Switch
switch := true;
sum := 0;
k := 1;
while k<4 do
switch := not(switch);
if switch
then
sum := sum+k
end if;
k := k+1
end while
Thus, these are the denotational semantics for statements.
For more details regarding denotational semantics, visit:
https://brainly.com/question/1190748
#SPJ1
Which of the following is considered an administrative function of the database management system (DBMS)?
A) adding structures to improve the performance of database applications
B) testing program codes in the system for errors
C) creating tables, relationships, and other structures in databases
D) using international standard languages for processing database applications
An administrative role of the database management system is the addition of structures to enhance the performance of database applications (DBMS).
What is a database system's primary purpose?Database software is used to build, modify, and maintain database files and records, making it simpler to create, enter, edit, update, and report on files and records. Data storage, backup, reporting, multi-access control, and security are other functions handled by the software.
Which 7 administrative tasks are there?Each of these tasks is essential to helping firms operate effectively and efficiently. Planning, organizing, staffing, directing, coordinating, reporting, and budgeting are the seven functions of management, or POSDCORB, that Luther Gulick, Fayol's successor, further defined.
To know more about database applications visit:-
https://brainly.com/question/28505285
#SPJ1
Fran can write a computer program in 9 days. If Doug helps her,they can write the program in 6 days. How long would it take Dougto write the program by himself.
Therefore, it would take Doug 18 days to complete the program by himself.
How to solve this?Let's assume Fran can complete 1 unit of work in a day. Then, Fran can complete the entire program in 9 days, which means the program consists of 9 units of work.
If Fran and Doug work together, they can complete the program in 6 days, which means their combined work rate is 9/6 = 1.5 units of work per day.
Let's assume Doug can complete x units of work in a day. Then, his work rate is x units of work per day.
Working together, Fran and Doug can complete 1.5 units of work per day, which means:
1 + x = 1.5
Therefore, Doug can complete 0.5 units of work in a day by himself.
To complete the entire program, which consists of 9 units of work, Doug will need:
9 / 0.5 = 18 days
Therefore, it would take Doug 18 days to complete the program by himself.
Read more about programming here:
https://brainly.com/question/23275071
#SPJ1
python using the while loop write a program that does the following: calculate the average of a series of homework grades (0 - 100) entered one at a time. in this case the lowest score will be dropped and the average computed with the remaining grades. for example suppose you enter the following grades: 78, 85, 81, 90, 88, 93 and 97. the average will be computed from the 6 grades 85, 81, 90, 88, 93 and 97. the low score of 78 will be dropped. output each grade (you can write it back out to the screen as each grade is entered), the dropped grade and the final average. run your program and show the output for the following two test cases: case 1: input grades 78, 85, 81, 90, 88, 93 and 97. case 2: input grades 75, 80, 83, 86, 90, 93, 87 and 77.
The code for mentioned function is given below.
Describe Programming?Programming refers to the process of writing instructions, also known as code, that a computer can execute to perform specific tasks. The goal of programming is to create software or applications that can automate tasks, solve problems, or provide a user with a specific service or functionality.
Here's a Python program that calculates the average of a series of homework grades entered one at a time, drops the lowest score, and computes the average of the remaining grades using a while loop:
# initialize variables
total = 0
count = 0
grades = []
# get input from user
grade = input("Enter a grade (0-100), or 'done' to finish: ")
# loop until user enters 'done'
while grade != "done":
# convert input to integer and append to list
grade = int(grade)
grades.append(grade)
count += 1
total += grade
# get input from user
grade = input("Enter a grade (0-100), or 'done' to finish: ")
# drop the lowest grade
lowest_grade = min(grades)
grades.remove(lowest_grade)
# compute the average
if count > 1:
average = (total - lowest_grade) / (count - 1)
else:
average = 0
# output each grade, the dropped grade, and the final average
print("Grades:", grades)
print("Dropped grade:", lowest_grade)
print("Average:", average)
Now we can test the program with the two test cases:
Test case 1:
Input:
Enter a grade (0-100), or 'done' to finish: 78
Enter a grade (0-100), or 'done' to finish: 85
Enter a grade (0-100), or 'done' to finish: 81
Enter a grade (0-100), or 'done' to finish: 90
Enter a grade (0-100), or 'done' to finish: 88
Enter a grade (0-100), or 'done' to finish: 93
Enter a grade (0-100), or 'done' to finish: 97
Enter a grade (0-100), or 'done' to finish: done
Output:
Grades: [85, 81, 90, 88, 93, 97]
Dropped grade: 78
Average: 89.0
Test case 2:
Input:
Enter a grade (0-100), or 'done' to finish: 75
Enter a grade (0-100), or 'done' to finish: 80
Enter a grade (0-100), or 'done' to finish: 83
Enter a grade (0-100), or 'done' to finish: 86
Enter a grade (0-100), or 'done' to finish: 90
Enter a grade (0-100), or 'done' to finish: 93
Enter a grade (0-100), or 'done' to finish: 87
Enter a grade (0-100), or 'done' to finish: 77
Enter a grade (0-100), or 'done' to finish: done
Output:
Grades: [75, 80, 83, 86, 90, 93, 87]
Dropped grade: 77
Average: 85.0
To know more about loop visit:
https://brainly.com/question/30706582
#SPJ1
C++
F3 Sort using a 2-Dimension Array of characters 15pts
Task -> Same as last. Implement the function specifications/prototypes. The driver program main() has been supplied.
Input the size of the 2 dimensional character array, then sort by row. Note: this problem is repeated in question 8 but you are required there to modify the ascii code for the sort. Here just use strcmp().
//System Libraries Here
#include //cin,cout
#include //strlen(),strcmp(),strcpy()
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Allowed like PI, e, Gravity, conversions, array dimensions necessary
const int COLMAX=80;//Only 20 required, and 1 for null terminator
//Function Prototypes Here
int read(char [][COLMAX],int &);//Outputs row and columns detected from input
void sort(char [][COLMAX],int,int);//Sort by row
void print(const char [][COLMAX],int,int);//Print the sorted 2-D array
//Program Execution Begins Here
int main(int argc, char** argv) {
//Declare all Variables Here
const int ROW=30; //Only 20 required
char array[ROW][COLMAX]; //Bigger than necessary
int colIn,colDet,rowIn,rowDet;//Row, Col input and detected
//Input the size of the array you are sorting
cout<<"Read in a 2 dimensional array of characters and sort by Row"<
cout<<"Input the number of rows <= 20"<
cin>>rowIn;
cout<<"Input the maximum number of columns <=20"<
cin>>colIn;
//Now read in the array of characters and determine it's size
rowDet=rowIn;
cout<<"Now input the array."<
colDet=read(array,rowDet);
//Compare the size input vs. size detected and sort if same
//Else output different size
if(rowDet==rowIn&&colDet==colIn){
sort(array,rowIn,colIn);
cout<<"The Sorted Array"<
print(array,rowIn,colIn);
}else{
if(rowDet!=rowIn)
cout<<(rowDet
"Row Input size greater than specified.")<
if(colDet!=colIn)
cout<<(colDet
"Column Input size greater than specified.")<
}
//Exit
return 0;
}
To implement the function specifications/prototypes. The driver program main() has been supplied, check the code given below.
What is function?A function is a derived type because the type of the data it returns determines its type. Arrays, pointers, enumerated types, structures, and unions are the other derived types. _Bool, char, int, long, float, double, long double, complex, etc. are examples of basic types.
//sortStrings.cpp
/*
* functions are defined like in the question
* colDet is the maximum string length in the input of strings
* it should match with colIn
*/
//System Libraries Here
#include <iostream>//cin,cout
#include <cstring> //strlen(),strcmp(),strcpy()
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Allowed like PI, e, Gravity, conversions, array dimensions necessary
const int COLMAX=80;//Only 20 required, and 1 for null terminator
//Function Prototypes Here
int read(char [][COLMAX],int &);//Outputs row and columns detected from input
void sort(char [][COLMAX],int,int);//Sort by row
void print(const char [][COLMAX],int,int);//Print the sorted 2-D array
int read(char array[][COLMAX],int *rowDet)
{
int i;
int rows = 0;
int cols = 0;
string input;
int len;
for(i = 0;i< *rowDet;i++)
{
cout<<"Enter string: ";
cin >> input;
len = input.length();
//insert into array if and only if the len is positive and lessthan the Maximum Length
if(len > 0 && len < COLMAX)
{
strcpy(array[rows],input.c_str());
rows++;
if(len>cols)
{
cols = len;
}
}
else
{
cout<<"Error Occured: Input String length should be > 0 and < "<<COLMAX<<endl;
}
}
*rowDet = rows;
return cols;
}
void sort(char array[][COLMAX],int rows,int cols)
{
int i,j;
char temp[COLMAX];
for(i = 0;i< rows;i++)
{
for(j = 0;j<rows-1;j++)
{
//string comparision on two strings
//if first is greater than the second then swap them
if(strcmp(array[j],array[j+1]) > 0)
{
strcpy(temp,array[j]);
strcpy(array[j],array[j+1]);
strcpy(array[j+1],temp);
}
}
}
}
void print(char array[][COLMAX],int rows,int cols)
{
int i;
//print the array of strings
for(i =0;i<rows;i++)
{
printf("%s ",array[i]);
}
}
//Program Execution Begins Here
int main(int argc, char** argv)
{
//Declare all Variables Here
const int ROW=30; //Only 20 required
char array[ROW][COLMAX]; //Bigger than necessary
int colIn,colDet,rowIn,rowDet;//Row, Col input and detected
//Input the size of the array you are sorting
cout<<"Read in a 2 dimensional array of characters and sort by Row"<<endl;
cout<<"Input the number of rows <= 20"<<endl;
cin>>rowIn;
cout<<"Input the maximum number of columns <=20"<<endl;
cin>>colIn;
//Now read in the array of characters and determine it's size
rowDet=rowIn;
cout<<"Now input the array."<<endl;
//maximum string length in the given input of strings
//so whatever the colIn input is given one of the inputs length should of same as colIn
colDet=read(array,&rowDet);
//if the maximum length string in the input of strings is < the inputed colIn
//make them equal
if(colDet <= colIn)
{
colDet = colIn;
}
//Compare the size input vs. size detected and sort if same
//Else output different size
if(rowDet==rowIn&&colDet==colIn)
{
sort(array,rowIn,colIn);
cout<<"The Sorted Array"<<endl;
print(array,rowIn,colIn);
}
else
{
if(rowDet!=rowIn)
cout<<(rowDet<rowIn?"Row Input size less than specified.":
"Row Input size greater than specified.")<<endl;
if(colDet!=colIn)
cout<<(colDet<colIn?"Column Input size less than specified.":
"Column Input size greater than specified.")<<endl;
}
//Exit
return 0;
}
Learn more about function
https://brainly.com/question/30175436
#SPJ1
The "Traveling Salesperson Problem" poses this question:
A salesperson is given a list of cities and the distances between them. The salesperson has to visit each city exactly once and then return to the first city. What is the shortest possible route the salesperson could take?
Assume an actual salesperson is trying to determine the shortest route she can take to visit 18 cities. She could use a computer program to calculate the distance of every possible route and then select the shortest one. Alternatively, she could use a heuristic to find a route.
Which of the following reasons would justify the use of a heuristic?
A
She has to pay for her own gas.
B
She has to leave in an hour.
C
She could potentially get a raise for being more efficient on her sales route than her coworkers.
D
She doesn't want to put too many miles on her car.
The reason that would justify the use of a heuristic is she could potentially get a raise for being more efficient on her sales route than her coworkers. Thus, the correct option for this question is C.
What is a Heuristic model?A heuristic model may be defined as a type of mental shortcut that is commonly utilized in order to simplify problems and avoid cognitive overload with respect to the actual conditions.
According to the context of this question, an actual salesperson is trying to determine the shortest route she can take to visit 18 cities. This is because she is usually required to become more efficient on her sales route than her coworkers. this will ultimately reflect her productivity.
Therefore, the reason that would justify the use of a heuristic is she could potentially get a raise for being more efficient on her sales route than her coworkers. Thus, the correct option for this question is C.
To learn more about Heuristics, refer to the link:
https://brainly.com/question/24053333
#SPJ1
Write the complete runtime function for the attached program SUMODD for each statement write c1, c2 etc and where appropriate n, n-1 etc follow the bubble sort example BUBBRT in "Introduction to Algorith Analysis"
#include
using namespace std;
int main()
{
int N=0, sum=0;
for(int k=0; k<5; k++)
{ cout<<"enter an integer "<
cin>>N; if(N%2==1)
sum = sum+N;
}
cout<<"sum of odd numbers "<
return 0;
}
Please, Delete this answer. Written by mistake.
The overall runtime of the program SUMODD is O(1), which means it will execute in constant time, regardless of the input size.
What is runtime function for the given program SUMODD?
Initialize N and sum to 0 - c1Enter a loop that will iterate 5 times (k < 5) - c2Within the loop, prompt the user to input an integer - c3Read in the integer from the user - c4Check if the integer is odd (N % 2 == 1) - c5If the integer is odd, add it to the current sum - c6End the if statement - c7End the loop - c8Print out the sum of the odd numbers - c9End the program - c10Therefore, the total runtime function for the given program SUMODD is:
T(n) = c1 + c2 + 5(c3 + c4 + c5 + c6 + c7) + c8 + c9 + c10
= O(1) + O(1) + 5*O(5) + O(1) + O(1) + O(1) + O(1) + O(1)
= O(1) + O(1) + O(25) + O(1) + O(1) + O(1) + O(1) + O(1)
= O(30)
= O(1)
Therefore, Overall runtime of the program SUMODD has to be O(1), which means that it will execute in constant time, regardless of the input size.
To know more about runtime , visit: https://brainly.com/question/13106116
#SPJ1
From the project manager perspective, which of the following are benefits of using data? Select all that apply.
a. Understand performance
b. Improve processes
c. Solve problems
d. Increase the project timeline
e. Make better decisions
f. Understand your users
From the perspective of the project manager, the benefits of using data are as follows:
Understand performance.Improve processes.Solve problems.Make better decisions.Understand your users.Thus, the correct options for this question are A, B, C, E, and F.
What are the benefits of a project manager?The benefits of a project manager are as follows:
Manage Budgets and Timelines.Improve Productivity and Overall Quality of Work.Mitigate Project Risks.Increase Customer Satisfaction.Gain a Competitive Advantage.The task of the project manager is not limited here. A project manager also improves the chances of achieving the desired result. gain a fresh perspective on your project, and how it fits with your business strategy. prioritize your business' resources and ensure their efficient use.
Therefore, from the perspective of the project manager, the benefits of using data are well described above.
To learn more about Project managers, refer to the link:
https://brainly.com/question/6500846
#SPJ1
If a client-centered therapist were treating a very anxious woman, the therapist would try toA. give sharp, insightful interpretations of her statements. B. repeatedly identify the client's unreasonable ideas and feelings. C. show unconditional positive regard for her statements. D. point out her misconceptions directly.
By showing unconditional positive regard, the therapist can help the client to feel safe and supported, which can facilitate the healing process.
What is the role of client-centered therapist?
If a client-centered therapist were treating a very anxious woman, the therapist would try to show unconditional positive regard for her statements.
This means that the therapist would create a nonjudgmental and accepting environment for the client to share her thoughts and feelings.
The therapist would validate the client's emotions and actively listen to her without imposing any agenda or interpretation on her.
Client-centered therapy is based on the belief that individuals have the capacity to solve their own problems with the help of a supportive and empathetic therapist.
Therefore, the therapist would not repeatedly identify the client's unreasonable ideas and feelings or point out her misconceptions directly.
This approach would not help the client to feel heard, understood, or empowered.
Instead, the therapist would help the client to explore her feelings and thoughts, develop her own insights and perspectives, and find her own solutions to her problems.
The therapist would offer empathy, warmth, and genuine interest in the client's experiences.
The therapist would not judge or criticize the client's thoughts or behaviors but would help her to feel accepted and understood.
Overall, client-centered therapy is a collaborative and respectful approach that focuses on the client's unique experiences and perspective.
To know more about client, visit: https://brainly.com/question/14753656
#SPJ1
1.)Click cell H9 on the Christensen worksheet and insert a formula that calculates the percentage Raymond paid of the issue price by dividing the amount Paid by the Issue Price. Copy the formula from cell H9 to the range H10:H54.2.)Click cell J9 and insert a formula that calculates the percentage change in value by subtracting the Issue Price from the Current Value and then dividing that result by the Issue Price. Copy the formula from cell J9 to the range J10:J54.
In cell H9, the formula used is =H9/G9, which will calculate the percentage Raymond paid of the Issue Price by dividing the amount Paid in cell H9 by the Issue Price in cell G9.
What is formula?A formula is a set of symbols or equations used to represent a relationship between two or more variables. It is a concise way of expressing information and is used in mathematics, science and engineering. Formulas can be used to calculate values, create graphs, and solve problems. They are often written with mathematical symbols, but can also be written in words. Formulas are used to describe natural phenomena, model physical systems, and to solve problems.
This formula can then be copied from cell H9 to the range H10:H54 to calculate the percentage paid for each issue.
In cell J9, the formula used is =(I9-G9)/G9, which will calculate the percentage change in value by subtracting the Issue Price from the Current Value in cell I9, and then dividing that result by the Issue Price in cell G9. This formula can then be copied from cell J9 to the range J10:J54 to calculate the percentage change in value for each issue.
To learn more about formula
https://brainly.com/question/30531811
#SPJ1
Select the correct answer.
Ivana is a network administrator. She wants to connect two different networks within her company. Which device should she use?
A.repeater
B.router
C.switch
D.bridge
E.modem
Please help me fast, and lmk if you can also help with more questions.
state 5 types physical security that can be found in an organization
Answer:
Access control systems to restrict unauthorized entry.
Surveillance systems to monitor activities in the premises.
Intrusion detection systems to detect and alert any suspicious activities.
Locking systems to secure valuable items and documents.
Perimeter fencing to restrict access to the premises.
please help me list the current system used
The current System Used include:
1. Library System
2. Membership Management System
3. Book Tracking System
4. Fines Management System
What are the systems about?Membership Management System is used to manage the process of receiving and processing applications for library membership. It may include features such as online registration, membership verification, and membership renewal.
The system maintains a database of member information, including contact details, membership status, and borrowing history. It also enables the library staff to manage membership fees, issue library cards, and track the circulation of library materials.
Book Tracking System is used to track the movement of books in the library. It maintains a database of all the books in the library's collection and their availability status.
Learn more about library on:
https://brainly.com/question/1348481
#SPJ1
For each of the actions below, select those actions below that are primarily in the network-layer data plane. The other actions that you don't select below then correspond to control-plane actions.
a. Monitoring and managing the configuration and performance of an network device
b. Looking up address bits in an arriving datagram header in the forwarding table.
c. Computing the contents of the forwarding table.
d. Moving an arriving datagram from a router’s input port to output port
e. Dropping a datagram due to a congested (full) output buffer.
Monitoring and controlling a network device's performance and configuration. Calculating the forwarding table's contents Dropping a datagram because the output buffer is crowded (full).
What duties does the network layer have?Making it feasible for multiple networks to connect to one another is the primary responsibility of the network layer. It does this by sending packets to network routers, which employ algorithms to select the best paths for the data to take.
Where is the network layer implemented within the network?Hosts at the edge of the network are where the network layer is implemented. In the network core, routers implement the network layer. Ethernet switches in a local area network implement the network layer.
To know more about network visit:-
https://brainly.com/question/13102717
#SPJ1
using boolean operators, to search for information about smartphones manufactured by apple you would type smartphones apple
While searching for information about smartphones manufactured by Apple, using the query "smartphones apple" without any Boolean operators may not be very effective. This is because the search engine will look for web pages that contain both the words "smartphones" and "Apple" but it will not necessarily prioritize pages that are specifically about Apple smartphones.
What is the boolean operators about?To refine the search results and make them more targeted, you can use Boolean operators to combine or exclude search terms. For example, to search for Apple smartphones, you could use the operator "AND" to combine the terms "Apple" and "smartphones" as follows:
"Apple" AND "smartphones"
Therefore, This query will return web pages that include both the words "Apple" and "smartphones", and will likely prioritize pages that specifically discuss or review Apple smartphones.
Learn more about Boolean operators from
https://brainly.com/question/1675220
#SPJ1
To search for information about smartphones manufactured by Apple using boolean operators, you could use the "AND" operator to connect the search terms "smartphones" and "Apple" together.
How will the AND Operator help?The "AND" operator will ensure that the search results contain both terms.
So you would type "smartphones AND Apple" in your search query to get results that contain both the keywords "smartphones" and "Apple".
This shows the usefulness of the boolean operator to search for information.
Read more about boolean operators here:
https://brainly.com/question/25487399
#SPJ1
Which of the following is used to review application code for signatures of known issues before it is packaged as an executable?O Static code analysisO DNS Security ExtensionsO Public cloudO Use correct certificate path
Before application code is packaged as an executable, static code analysis is done to check it for traces of previously reported problems.
Static code analysis: Why use it?Static code analysis enables you to detect faults in code before it is compiled or run, as well as to inform developers of any additional problems, such as a lack of inline documentation, poor coding practises, security risks, poor performance, etc.
How valuable is static code analysis?The ability to properly evaluate all of your code without even running it is one of the main benefits of static analysis for (static application security testing). This is the reason why it may find weaknesses in even the most remote and unsupervised areas of the code also.
To know more about static code visit:-
https://brainly.com/question/29217325
#SPJ1
When you build a computer from parts, you usually start by deciding on which two parts listed below?a. motherboardb. processorc. video cardd. casee. RAM
When building a computer from parts, you typically start by deciding on which two parts below:
a. motherboardb. processorWhy are they important?The motherboard and processor are two of the most critical components of a computer, as they determine the compatibility of other parts and the overall performance of the system.
The motherboard serves as the backbone of the system, connecting all other components and providing power and data transfer between them.
Read more about computers here:
https://brainly.com/question/28498043
#SPJ1