Answer:
Op code table.
Explanation:
In Computer programming, an Op code is the short term for operational code and it is the single instruction which can be executed by the central processing unit (CPU) of a computer.
The conversion of symbolic op codes such as LOAD, ADD, and SUBTRACT to binary makes use of a structure called the Op code table. The Op code can be defined as a visual representation of the entire operational codes contained in a set of executable instructions.
An Op code table is arranged in rows and columns which basically represents an upper or lower nibble and when combined depicts the full byte of the operational code. Each cells in the Op code table are labeled from 0-F for the rows and columns; when combined it forms values ranging from 00-FF which contains information about CPU cycle counts and instruction code parameters.
Hence, if the operational code table is created and sorted alphabetically, the binary search algorithm can be used to find an operational code to be executed by the central processing unit (CPU).
What is a what if analysis in Excel example?
Answer:
What-If Analysis in Excel allows you to try out different values (scenarios) for formulas. The following example helps you master what-if analysis quickly and easily.
Assume you own a book store and have 100 books in storage. You sell a certain % for the highest price of $50 and a certain % for the lower price of $20.
(i really hope this is what u needed)
Type the correct answer in the box.
Who is responsible for creating and testing the incident response plan?
The _______ is responsible for creating and testing the incident response plan.
Answer: CSIRT
Explanation: CSIRT is team that specializes in day to day cyber incidents
The CSIRT is responsible for creating and testing the incident response plan.
What is CSIRT?CSIRT is the Computer emergency response team. One of the key areas for the efficient operation of a corporation is the legal department. Professionals face enormous challenges, particularly when you take into account the need for other bodies within the company itself.
We can list the reviews of the CSIRT procedures that are conducted through this department as one of its key responsibilities. This department also has the responsibility of comprehending the actions that the CSIRT will take to ensure that they comply with all applicable federal, state, and local laws and regulations.
Therefore, the incident response strategy must be written and tested by the CSIRT.
To learn more about CSIRT, refer to the link:
https://brainly.com/question/18493737
#SPJ2
In the Stop-and-Wait flow-control protocol, what best describes the sender’s (S) and receiver’s (R) respective window sizes?
Answer:
The answer is "For the stop and wait the value of S and R is equal to 1".
Explanation:
As we know that, the SR protocol is also known as the automatic repeat request (ARQ), this process allows the sender to sends a series of frames with window size, without waiting for the particular ACK of the recipient including with Go-Back-N ARQ. This process is mainly used in the data link layer, which uses the sliding window method for the reliable provisioning of data frames, that's why for the SR protocol the value of S =R and S> 1.Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed to a calculateCharge function that computes and returns the shipping charge to be displayed . The main function should loop to handle multiple packages until a weight of 0 is entered.
Answer:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int WEIGHT_MIN = 0,
WEIGHT_MAX = 20,
DISTANCE_MIN = 10,
DISTANCE_MAX = 3000;
float package_weight,
distance,
total_charges;
cout << "\nWhat is the weight (kg) of the package? ";
cin >> package_weight;
if (package_weight <= WEIGHT_MIN ||
package_weight > WEIGHT_MAX)
{
cout << "\nWe're sorry, package weight must be\n"
<< " more than 0kg and less than 20kg.\n"
<< "Rerun the program and try again.\n"
<< endl;
}
else
{
cout << "\nDistance? ";
cin >> distance;
if (distance < DISTANCE_MIN ||
distance > DISTANCE_MAX)
{
cout << "\nWe're sorry, the distance must be\n" << "within 10 and 3000 miles.\n"
<< "Rerun the program and try again.\n"
<< endl;
}
else
{
if (package_weight <= 2)
total_charges = (distance / 500) * 1.10;
else if (package_weight > 2 &&
package_weight <= 6)
total_charges = (distance / 500) * 2.20;
else if (package_weight > 6 &&
package_weight <= 10)
total_charges = (distance / 500) * 3.70;
else if (package_weight > 10 &&
package_weight <= 20)
total_charges = (distance / 500) * 4.80;
cout << setprecision(2) << fixed
<< "Total charges are $"
<< total_charges
<< "\nFor a distance of "
<< distance
<< " miles\nand a total weight of "
<< package_weight
<< "kg.\n"
<< endl;
}
}
Explanation:
Steve wants to take charge of his finances. To do so, he must track his income and expenditures. To accurately calculate his take-home pay, Steve must use his __________.
Answer:brain
Explanation:
to think
What is the main advantage of using DHCP? A. Allows you to manually set IP addresses B. Allows usage of static IP addresses C. Leases IP addresses, removing the need to manually assign addresses D. Maps IP addresses to human readable URLs
Answer: DHCP (dynamic host configuration protocol) is a protocol which automatically processes the configuring devices on IP networks.It allows them to to use network services like: NTP and any communication proto cal based on UDP or TCP. DHCP assigns an IP adress and other network configuration parameters to each device on a network so they can communicate with other IP networks. it is a part of DDI solution.
Explanation:
1| def saveUserProfile(firstName, lastName, age, height, country):
2| filename = lastName + firstName + ".txt"
3| outputFile = open(filename, "w")
4| print(lastName, file = outputFile)
5| print(firstName, file = outputFile)
6| print(country, file = outputFile)
7| print(height, file = outputFile)
8| print(age, file = outputFile)
9| outputFile.close()
Above is a function that takes five pieces of information about a user and saves that data to a file. We'll assume firstName, lastName, and country are strings, age is an integer, and height (expressed in meters) is a float.
Assume we call the function above with this line of code:
saveUserProfile("David", "Joyner", 30, 1.8, "USA")
After the function runs, what is name of the file that is created?
a. What is written on line 1 of that file? If there is no line 1 or if line 1 is blank, enter Nothing.
b. What is written on line 2 of that file? If there is no line 2 or if line 2 is blank, enter Nothing.
c. What is written on line 3 of that file? If there is no line 3 or if line 3 is blank, enter Nothing.
d. What is written on line 4 of that file? If there is no line 4 or if line 4 is blank, enter Nothing.
e. What is written on line 5 of that file? If there is no line 5 or if line 5 is blank, enter Nothing.
Answer:
Joyner
David
USA
1.8
30
Explanation:
def saveUserProfile(firstName, lastName, age, height, country):
This is the definition of function named saveUserProfile which accepts the following parameters:
firstNamelastNameageheightcountryfilename = lastName + firstName + ".txt"
When the file is created it will be named as the lastName and firstName string combined with .txt as extension. For example if the lastName contains the name string Joyner and firstName contains the name David then the file created to be written is named as JoynerDavid.txt
outputFile = open(filename, "w")
This statement uses open() method in write mode and uses outputFile object to access the file. "w" represents write mode i.e. file is opened in write mode to write on it.
a) Joyner is written on line 1 of that file because of the following statement of above function:
print(lastName, file = outputFile)
This statement prints the string stored in lastName i.e. Joyner. Here outputFile opens the file in "w" write mode and writes the last name to the first line of the file.
b) David is written on line 2 of that file because of the following statement of above function:
print(firstName, file = outputFile)
This statement prints the string stored in firstName i.e. David. Here outputFile opens the file in "w" write mode and writes the first name to the second line of the file.
c) USA is written on line 3 of that file because of the following statement of above function:
print(country, file = outputFile)
This statement prints the data stored in country i.e. USA. Here outputFile opens the file in "w" write mode and writes the country name to the third line of the file.
d) 1.8 is written on line 4 of that file because of the following statement of above function:
print(height, file = outputFile)
This statement prints the value stored in height i.e. 1.8. Here outputFile opens the file in "w" write mode and writes the height value to the fourth line of the file.
e) 30 is written on line 5 of that file because of the following statement of above function:
print(age, file = outputFile)
This statement prints the value stored in age parameter of function saveUserProfile i.e. 30. Here outputFile opens the file in "w" write mode and writes the age value to the fifth line of the file.
A program is considered portable if it . . . can be rewritten in a different programming language without losing its meaning. can be quickly copied from conventional RAM into high-speed RAM. can be executed on multiple platforms. none of the above
Answer:
Can be executed on multiple platforms.
Explanation:
A program is portable if it is not platform dependent. In other words, if the program is not tightly coupled to a particular platform, then it is said to be portable. Portable programs can run on multiple platforms without having to do much work. By platform, we essentially mean the operating system and hardware configuration of the machine's CPU.
Examples of portable programs are those written in;
i. Java
ii. C++
iii. C
A security administrator is investigating a report that a user is receiving suspicious emails. The user's machine has an old functioning modem installed. Which of the following security concerns need to be identified and mitigated? (Select TWO).
a) Vishing
b) Whaling
c) Spear phishing
d) Pharming
e) War dialing
f) Hoaxing
Answer:
Spear Phishing and War Dialing
Explanation:
So let's tackle these one at a time.
Vishing is simply any type of message (i.e., email, text, phone call, etc.) that appears to be from a trusted source but is not.
Whaling is simply a spear phishing attack of a high-value target such as a CEO or someone with high-level access at a company.
Spear phishing is simply a targeted phishing attack, usually towards a specific person or group of people. (Phishing attack is simply a social attack to try and gain unauthorized access to a resource).
Pharming is an attack that attempts to redirect website traffic to a fake site.
War dialing is a technique to automatically scan a list of numbers in an area in attempt to search for exposed modems, computers, board systems, or fax machines, in order to breach the network.
Hoaxing is simply a social attack that describes a serious threat in attempts to retrieve unauthorized access or money from a victim. (Think microsoft tech support scams)
Now that we have defined these things, let's identify the possible threats that need to be reported.
(a) Vishing? The sec admin report doesn't mention the source of the message so we cannot associate this one
(b) Whaling? The sec admin report says a user, implying someone not high up in the company, but doesn't say it's not someone high up. This is possible.
(c) Spear phishing? The sec admin report says a user, implying that only this user is being targeted so this is definitely valid.
(d) Pharming? The sec admin report says nothing about site redirection.
(e) War dialing? The sec admin report doesn't say anything about unauthorized scanning; however, it mentions the user has an old functioning modem, so this is possible.
(f) Hoaxing? The sec admin report doesn't mention a pop up in the email or the content of the email so we are uncertain.
Thus with these considerations, the two threats that are identified and need mitigation are Spear phishing and War Dialing/Whaling. Note that we aren't positive of the war dialing or whaling, but a case could be made for either; however, given the modem information, the question seems to indicate war dialing.
Would you expect all the devices listed in BIOS/UEFI setup to also be listed in Device Manager? Would you expect all devices listed in Device Manager to also be listed in BIOS/UEFI setup?
Answer:
1. Yes
2. No
Explanation:
1 Note that the term BIOS (Basic input and Output System) refers to instructions that controls a computer device operations. Thus, devices that shows up in BIOS should be in device manager.
2. Not all devices listed in devcie manager of a computer system will be listed in BIOS.
Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences of the same character in the string replaced by a single occurrence of that character. For example, the call of removeDuplicates("bookkeeeeeper") should return "bokeper" .
Answer:
//Method definition
//Method receives a String argument and returns a String value
public static String removeDuplicates(String str){
//Create a new string to hold the unique characters
String newString = "";
//Create a loop to cycle through each of the characters in the
//original string.
for(int i=0; i<str.length(); i++){
// For each of the cycles, using the indexOf() method,
// check if the character at that position
// already exists in the new string.
if(newString.indexOf(str.charAt(i)) == -1){
//if it does not exist, add it to the new string
newString += str.charAt(i);
} //End of if statement
} //End of for statement
return newString; // return the new string
} //End of method definition
Sample Output:
removeDuplicates("bookkeeeeeper") => "bokeper"
Explanation:
The above code has been written in Java. It contains comments explaining every line of the code. Please go through the comments.
The actual lines of codes are written in bold-face to distinguish them from comments. The program has been re-written without comments as follows:
public static String removeDuplicates(String str){
String newString = "";
for(int i=0; i<str.length(); i++){
if(newString.indexOf(str.charAt(i)) == -1){
newString += str.charAt(i);
}
}
return newString;
}
From the sample output, when tested in a main application, a call to removeDuplicates("bookkeeeeeper") would return "bokeper"
A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event. Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not exist or the format is incorrect.
Answer:
Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?
Explanation:
Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?
3.16 (Gas Mileage) Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a program that will input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful. After processing all input information, the program should calculate and print the combined miles per gallon obtained for all tankfuls. Here is a sample input/output dialog:
Answer:
I am writing a C program.
#include <stdio.h> // for using input output functions
#include <stdbool.h> // for using a bool value as data type
int main() { // start of the main() function body
int count=0; //count the number of entries
double gallons, miles, MilesperGallon, combined_avg, sum; //declare variables
while(true) {// takes input gallons and miles value from user and computes avg miles per gallon
printf( "Enter the gallons used (-1 to stop): \n" ); //prompts user to enter value of gallons or enter -1 to stop
scanf( "%lf", &gallons );//reads the value of gallons from user
if ( gallons == -1 ) {// if user enters -1
combined_avg = sum / count; //displays the combined average by dividing total of miles per drives to no of entries
printf( "Combined miles per gallon for all tankfuls: %lf\n", combined_avg ); //displays overall average value
break;} //ends the loop
printf( "Enter the miles driven: \n" ); //if user does not enter -1 then prompts the user to enter value of miles
scanf( "%lf", &miles ); //read the value of miles from user
MilesperGallon = miles / gallons; //compute the miles per gallon
printf( "The miles per gallon for tankful: %lf\n", MilesperGallon ); //display the computed value of miles per gallon
sum += MilesperGallon; //adds all the computed miles per gallons values
count += 1; } } //counts number of tankfuls (input entries)
Explanation:
The program takes as input the miles driven and gallons used for each tankful. These values are stored in miles and gallons variables. The program calculates and displays the miles per gallon MilesperGallon obtained for each tankful by dividing the miles driven with the gallons used. The while loop continues to execute until the user enters -1. After user enters -1, the program calculates and prints the combined miles per gallon obtained for all tankful. At the computation of MilesperGallon for each tankful, the value of MilesperGallon are added and stored in sum variable. The count variable works as a counter which is incremented to 1 after each entry. For example if user enters values for miles and gallons and the program displays MilesperGallon then at the end of this iteration the value of count is incremented to 1. This value of incremented for each tankful and then these values are added. The program's output is attached.
Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.
Answer:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double side, height;
cout<<"Enter the length of one of the sides of the base: ";
cin>>side;
cout<<"Enter the height: ";
cin>>height;
double area = side * side;
double volume = area * height / 3;
cout<<"The area of the base of the pyramid is: "<<area<<endl;
cout<<"The height of the pyramid is: "<<height<<endl;
cout<<"The volume of the pyramid is: "<<fixed<<setprecision(2)<<volume<<endl;
return 0;
}
Pseudocode:
Declare side, height
Get side
Get height
Set area = side * side
Set volume = area * height / 3
Print area
Print height
Print volume
Explanation:
Include <iomanip> to have two decimal places
Declare the side and height
Ask the user to enter side and height
Calculate the base area, multiply side by side
Calculate the volume using the given formula
Print area, height and volume (use fixed and setprecision(2) to have two decimal places)
An organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. Which of the following solutions should the engineer recommend?a. Web application firewall b. SIEM c. IPS d. UTM e. File integrity monitor
Answer:
b. SIEM.
Explanation:
In this scenario, an organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. The solution the engineer should recommend is the Security information and event management (SIEM).
Security information and event management is an enterprise software that provides a holistic view and analyzes activity from various resources across an entire information technology (IT) infrastructure.
The SIEM is used to aggregate important data from multiple source such as servers, routers, firewall, switches, domain controllers, antivirus software and analyzes the data to detect any threat, deviation from the norm, as well as investigate in order to take appropriate actions. Some examples of the SIEM system are IBM QRadar, Splunk, LogRhythm etc.
Which of these statements are true about managing through Active Directory? Check all that apply.
Answer:
ADAC uses powershell
Domain Local, Global, and Universal are examples of group scenes
Explanation:
Active directory software is suitable for directory which is installed exclusively on Windows network. These directories have data which is shared volumes, servers, and computer accounts. The main function of active directory is that it centralizes the management of users.
It should be noted thst statements are true about managing through Active Directory are;
ADAC uses powershellDomain Local, Global, and Universal are examples of group scenes.Active Directory can be regarded as directory service that is been put in place by Microsoft and it serves a crucial purpose for Windows domain networks.
It should be noted that in managing through Active, ADAC uses powershell.
Therefore, in active directory Domain Local, Global, and Universal are examples of group scenes .
Learn more about Active Directory at:
https://brainly.com/question/14364696
A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right.
For example, we can shift the bits in the string 1011 two places to the left to produce the string 1110. Note that the leftmost two bits are wrapped around to the right side of the string in this operation.
Define two scripts, shiftLeft.py and shiftRight.py, that expect a bit string as an input.
The script shiftLeft shifts the bits in its input one place to the left, wrapping the leftmost bit to the rightmost position.
The script shiftRight performs the inverse operation.
Each script prints the resulting string.
An example of shiftLeft.py input and output is shown below:
Enter a string of bits: Hello world!
ello world!H
An example of shiftRight.py input and output is shown below:
Enter a string of bits: Hello world!
!Hello world
Answer:
Following are the code to this question:
Defining method shiftLeft:
def shiftLeft(bit_string): #defining method shiftLeft, that accepts parameter bit_string
bit_string= bit_string[1:]+bit_string[0]#use bit_string to provide slicing
return bit_string#return bit_string value
bit_string =input("Enter value: ")#defining bit_string variable for user input
print (shiftLeft(bit_string))#use print method to call shiftLeft method
Defining method shiftRight:
def shiftRight(bit_string):#defining method shiftRight, which accepts bit_string variable
bit_string=bit_string[len(bit_string)-1]+bit_string[0:len(bit_string)-1]#using bit_string variable for slicing
return bit_string#return bit_string calculated value
bit_string= input("Enter value: ")#defining bit_string variable for user input
print(shiftRight(bit_string))#use print method to call shiftLeft method
Output:
Please find the attachment.
Explanation:
method description:
In the above-given python code two methods "shiftLeft and shiftRight" are declared, in which both the method accepts a string variable "bit_string". Inside methods, we use the slicing, in which it provides to use all the sequence values and calculated the value in this variable and return its value. At the last step, the bit_string variable is used to input value from the user end and call the method to print its value.why does study state that unless you were sleeping it is almost impossible not to be communicating?
Answer:
Because your movements, expressions, and posture are also a type of communication
Explanation:
When you use Word's Email option to share a document, you should edit the _____ line to let the recipient know the email is from a legitimate source.
Answer:
Subject line
Explanation:
Editing the subject line is very important so as to enable the recipient know the source of received the message (document).
For example, if a remote team working on a project called Project X receives a shared document by one member of team, we would expect the subject line of the email to be– Project X document. By so doing the legitimacy of the email is easily verified.
Velma is graduating from Ashford at the end of next year. After she completes her final class, she will reward herself for her hard work with a week-long vacation in Hawaii. But she wants to begin saving money for her trip now. Which of the following is the most effective way for Velma to save money each month?
This question is incomplete because the options are missing; here are the options for this question:
Which of the following is the most effective way for Velma to save money each month?
A. Automatically reroute a portion of her paycheck to her savings account.
B. Manually deposit 10% of her paycheck in her savings account.
C. Pay all of her bills and then place the remaining money in her savings account.
D. Pay all of her bills and then place the remaining money in her piggy bank.
The correct answer to this question is A. Automatically reroute a portion of her paycheck to her savings account.
Explanation:
In this case, Velma needs to consistently save money for her vacation as this guarantees she will have the money for the trip. This means it is ideal every month she contributes consistently to her savings for the vacation.
This can be better be achieved by automatically rerouting a part of her paycheck for this purpose (Option A) because in this way, every month the money for the vacations will increase and the amount of money will be consistent, which means Velma will know beforehand the money she will have for the vacation. Moreover, options such as using a piggy bank or paying the bills and using the rest for her savings, do not guarantee she will contribute to the savings every month, or she will have the money she needs at the end.
An algorithm that could execute for an unknown amount of time because it depends on random numbers to exit a function may:_______
a. have a redundancy.
b. get caught in an infinite loop.
c. suffer from indefinite postponement.
d. issue a compiler error.
Answer:
c. suffer from indefinite postponement.
Explanation:
Algorithm is a set of rules that are followed in calculations or other problem solving operation by a computer. An algorithm may execute for unknown amount of time and it may suffer indefinite postponement. Algorithm depends on random numbers and it can execute continuously.
Assuming a Stop-and-Wait system, if the bandwidth-delay product of a channel is 500 Mbps and 1 bit takes 25 milliseconds to make the roundtrip, what is the bandwidth-delay product? If the data packets are 2500 bits in length, what is the utilization?
Answer:
Bandwidth delay product = 2500 Kbits
Utilization = 0.02%
Explanation:
We proceed as follows;
From the question, we are given that
band width = 500 Mbps
The bandwidth-delay product is = 500 x 10^6 x 25 x 10^-3
= 2500 Kbits
The system can send 12500 Kbits during the time it takes for the data to go from the sender to the receiver and then back again.
However, the system sends only 2500 bits.
The the link utilization =
2500/(12500 x 10^3) = 0.02%
Write a program segment that simulates flipping a coin 25 times by generating and displaying 25 random integers, each of which is either 1 or 2
Answer:
//import the Random class
import java.util.Random;
//Begin class definition
public class CoinFlipper {
//The main method
public static void main(String []args){
//Create an object of the Random class
Random ran = new Random();
System.out.println("Result");
//Use the object and the number of times for simulation
//to call the flipCoin method
flipCoin(ran, 25);
} //End of main method
//Method to flip coin
public static void flipCoin(Random ran, int nooftimes){
//Create a loop to run as many times as specified in variable nooftimes
for(int i=1; i<=nooftimes; i++)
System.out.println(ran.nextInt(2) + 1);
}
} //End of class definition
====================================================
Sample Output:
Result
1
1
1
2
1
2
2
1
2
1
1
2
1
2
1
1
1
2
1
1
1
2
2
1
2
========================================================
Explanation:
The above code has been written in Java. It contains comments explaining every part of the code. Please go through the comments.
The sample output from the execution of the code is also given above.
The code is re-written as follows without comments.
import java.util.Random;
public class CoinFlipper {
public static void main(String []args){
Random ran = new Random();
System.out.println("Result");
flipCoin(ran, 25);
}
public static void flipCoin(Random ran, int nooftimes){
for(int i=1; i<=nooftimes; i++)
System.out.println(ran.nextInt(2) + 1);
}
}
Description:
Create a program that converts the number of miles that you walked on a hike to the number of feet that you walked.
Console:
Hike Calculator
How many miles did you walk?: 4.5
You walked 23760 feet.
Continue? (y/n): y
How many miles did you walk?: 2.5
You walked 13200 feet.
Continue? (y/n): n
Bye!
Specifications:
The program should accept a float value for the number of miles.
Store the code that gets user input and displays output in the main function.
There are 5280 feet in a mile.
Store the code that converts miles to feet in a separate function. This function should return an int value for the number of feet.
Assume that the user will enter a valid number of miles.
Answer:
The programming language is not stated (I'll answer using C++)
#include <iostream>
using namespace std;
int convert(float miles)
{
return miles * 5280;
}
int main() {
cout<<"Console:"<<endl;
cout<<"Hike Calculator"<<endl;
float miles;
char response;
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
while(response == 'y')
{
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
}
cout<<"Bye!";
return 0;
}
Explanation:
Here, I'll explain some difficult lines (one after the other)
The italicized represents the function that returns the number of feet
int convert(float miles)
{
return miles * 5280;
}
The main method starts here
int main() {
The next two lines gives an info about the program
cout<<"Console:"<<endl;
cout<<"Hike Calculator"<<endl;
float miles;
char response;
This line prompts user for number of miles
cout<<"How many miles did you walk?. ";
cin>>miles;
This line calls the function that converts miles to feet and prints the feet equivalent of miles
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
This line prompts user for another conversion
cout<<"Continue? (y/n): ";
cin>>response;
This is an iteration that repeats its execution as long as user continue input y as response
while(response == 'y')
{
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
}
cout<<"Bye!";
For the Python program below, will there be any output, and will the program terminate?
while True: while 1 > 0: break print("Got it!") break
a. Yes and no
b. No and no
c. Yes and yes
d. No and yes
e. Run-time error
Programming Challenge: Test Average CalculatorUsing a variable length array, write a C program that asks the user to enter test scores.Then, the program should calculate the average, determine the lowest test score, determine the letter grade, and display all three.
Answer:
well you could use variables in C and display them
Explanation:
Why do you think it is necessary to set the sequence in which the system initializes video cards so that the primary display is initialized first
Answer:
Because if you don't do it BIOS doesn't support it. ... In troubleshooting a boot problem what would be the point of disabling the quick boot feature in BIOS setup
Explanation:
What is the absolute pathname of the YUM configuration file? REMEMBER: An absolute pathname begins with a forward slash
Answer:
/etc/yum.conf
Explanation:
The absolute pathname for YUM is /etc/yum.conf. The configuration file For yum and related utilities can be found there. The file has one compulsory section, and this section can be used to place Yum options with global effect, it could also have one or more sections, that can enable you to set repository-specific options.
You are a project manager for Laredo Pioneer's Traveling Rodeo Show. You're heading up a project to promote a new line of souvenirs to be sold at the shows. You are getting ready to write the project management plan and know you need to consider elements such as policies, rules, systems, relationships, and norms in the organization. Which of the following is not true? A These describe the authority level of workers, fair payment practices, communication channels, and the like. B This describes organizational governance framework. C This describes management elements. D This is part of the EEF input to this process.
Answer:
A. These describe the authority level of workers, fair payment practices, communication channels, and the like.
Explanation:
As seen in the question above, you have been asked to write the project management plan and know that you need to consider elements such as policies, rules, systems, relationships and standards in the organization. These elements are part of EEF's entry into this process, in addition they are fundamental and indispensable for the description not only of the organizational governance structure, but also describe the management elements that will be adopted and used.
However, there is no way to use them to describe the level of authority of workers, fair payment practices, communication channels and the like, as this is not the function of this.
Suppose that an engineer excitedly runs up to you and claims that they've implemented an algorithm that can sort n elements (e.g., numbers) in fewer than n steps. Give some thought as to why that's simply not possible and politely explain
Answer:
The summary including its given problem is outlined in the following section on the interpretation.
Explanation:
That's not entirely feasible, since at least n similarities have to be made to order n quantities. Find the finest representation where the numbers of 1 to 10 have already been arranged.
⇒ 1 2 3 4 5 6 7 8 9 10
Let's say that we identify one figure as the key then compared it towards the numbers across the left. Whether the correct number is greater, therefore, left number, are doing nothing to switch the location elsewhere.
Because although the numbers have already been categorized 2 has always been compared to 1 which would be perfect, 3 becomes especially in comparison to 2 and so much more. This should essentially take 9 moves, or nearly O(n) moves.
If we switch that little bit already
⇒ 1 3 2 4 5 6 7 8 9 10
3 Is contrasted with 1. 2 will indeed be matched against 3 as well as 2. Since 2 has indeed been exchanged, it must, therefore, be matched with 1 as there might be a case whereby each number z exchanged is greater than the number Y as well as the quantity X < Y.
X = 1, Y = 3, and Z = 2.Only one adjustment expanded the steps which culminated in n+1.
It should be noted that it won't be possible because at least n similarities have to be made to order n quantities.
From the information given, it should be noted that it's not possible for the engineer to implement an algorithm that can sort n elements (e.g., numbers) in fewer than n steps.
This is because there are at least n similarities have to be made to order n quantities. In this case, the numbers of 1 to 10 have already been arranged. When a number is greater, it should be noted that the left number will do nothing to switch the location elsewhere.
Therefore, the information given by the engineer isn't feasible.
Learn more about algorithms on:
https://brainly.com/question/24953880