CHALLENGE ACTIVITY |
6.2.2: Function call in expression.
Assign to maxSum the max of (numa, numB) PLUS the max of (numy, numz). Use just one statement. Hint: Call FindMax() twice in an expression.
1. #include
2. using namespace std; passed
3.
4. double FindMax(double numi,
5. double num2) { double maxVal; emos
6.
7. // Note: if-else statements need not be understood to complete this activity
8. if (numi > num2) { // if num1 is greater than num2,
9. maxVal = num1; // then num1 is the maxVal.
10.
11. All tests passed else
12. {maxVal = num2; // Otherwise, // num2 is the maxval.
13.
14.
15. return maxVal;
16. }
17.
18. int main() {
19. double numA;
20. double numB;
21. double numY;
22. double numz;

Answers

Answer 1

Answer:

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

The maxSum is a double type variable which is assigned the maximum of the two variables numA numB PLUS the maximum of the two variables numY numZ using FindMax function. The FindMax() method is called twice in this statement one time to find the maximum of numA and numB and one time to find the maximum of numY numZ. When the FindMax() method is called by passing numA and numB as parameters to this method, then method finds if the value of numA is greater than that of numB or vice versa. When the FindMax() method is called by passing numY and numZ as parameters to this method, then method finds if the value of numY is greater than that of numZ or vice versa. The PLUS sign between the two method calls means that the resultant values returned by the FindMax() for both the calls are added and the result of addition is assigned to maxSum.

Explanation:

This is where the statement will fit in the program.

#include <iostream>

using namespace std;

double FindMax(double num1, double num2) {

  double maxVal = 0.0;    

  if (num1 > num2) { // if num1 is greater than num2,

     maxVal = num1;  // then num1 is the maxVal.    }

  else {          

     maxVal = num2;  // num2 is the maxVal.   }

  return maxVal; }  

int main() {

  double numA;

  double numB;

  double numY;

  double numZ;

  double maxSum = 0.0;  

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

  cout << "maxSum is: " << maxSum << endl;   }

Lets take an example to explain this. Lets assign values to the variables.

numA = 6.0

numB = 3.0

numY = 4.0

numZ = 9.0

maxSum =0.0

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);  

FindMax(numA,numB) method call checks if numA>numB or numB>numA and returns the maximum of the two. Here numA>numB because 6.0 is greater than 3.0. So the method returns numA i.e. 6.0

FindMax(numY, numZ) method call checks if numY>numZ or numZ>numY and returns the maximum of the two. Here numZ>numY because 9.0 is greater than 4.0. So the method returns numZ i.e. 9.0

FindMax(numA, numB) + FindMax(numY, numZ) this adds the two values returned by the method FindMax for each call.

FindMax returned maxVal from numA and numB values which is numA i.e. 6.0.

FindMax returned maxVal from numY and numZ values which is numZ i.e. 9.0.

Adding these two values 9.0 + 6.0 = 15

So the complete statement  FindMax(numA, numB) + FindMax(numY, numZ) gives 15.0  as a result.

This result is assigned to maxSum. Hence

maxSum = 15

To see the output on the screen you can use the print statement as:

cout<<maxSum;

This will display 15

CHALLENGE ACTIVITY | 6.2.2: Function Call In Expression. Assign To MaxSum The Max Of (numa, NumB) PLUS
Answer 2

The code for function calling is coded below.

To assign the maximum sum of `(numA, numB)` plus the maximum of `(numY, numZ)` to the variable `maxSum` using just one statement, you can call the `FindMax()` function twice in an expression.

Here's the code:

maxSum = FindMax(numA, numB) + FindMax(numY, numZ);

This code calls the `FindMax()` function twice, once with the parameters `(numA, numB)` and again with the parameters `(numY, numZ)`.

It calculates the maximum of each pair of numbers using the `FindMax()` function and then adds the two maximum values together. The result is assigned to the `maxSum` variable.

Learn more about Function call here:

https://brainly.com/question/31798439

#SPJ6


Related Questions

I have tried looking for this answer everywhere, and I could not find the answer

I have a Windows 10 Laptop, with a 12GB RAM Card, okay? I also have my 1TB Disk Partitioned so that I have 3 Disks. 2 of them are my primary, both of those are 450GB apiece. The last one ([tex]Z:[/tex]) I named "RAM" and set that one to 100GB.

How do I turn the drive [tex]Z:[/tex] into strictly RAM?
I already did the Virtual Memory part of it, but I was wondering if I can make it strictly RAM so the system uses drive [tex]Z:[/tex] before using the RAM disk? If it is not possible, I'm sorry.

Answers

If my computer has 4 gigabytes of ram memory then I have 4e+9 bytes of memory.  I think-

Answer: That isn't a software problem, its a hardware problem. There is a difference between 12gb of ram versus 100 gb of HDD. Ram is temporary storage, you can not turn SSD or HDD storage into RAM. If you are a gamer, STEER AWAY FROM LAPTOPS, DO NOT BUY A GAMING LAPTOP. Either buy a DESKTOP (or build) or a console. They give more performance for the price and they are easily upgradable. Not many people can open up a laptop and put in more RAM because the hardware is incredibly small.

Write a program that displays the values in the list numbers in ascendingorder sorted by the sum of their digits.

Answers

Answer:

Here is the Python program.

def DigitList(number):  

   return sum(map(int, str(number)))  

 

list = [18, 23, 35, 43, 51]  

ascendList = sorted(list, key = DigitList)  

print(ascendList)

Explanation:

The method DigitList() takes value of numbers of the list as parameter. So this parameter is basically the element of the list. return sum(map(int, str(number)))  statement in the DigitList() method consists of three methods i.e. str(), map() and sum(). First the str() method converts each element of the list to string. Then the map() function is used which converts every element of list to another list. That list will now contain digits as its elements. In short each number is converted to the string by str() and then the digit characters of each string number is mapped to integers. Now these digits are passed to sum() function which returns the sum. For example we have two numbers 12 and 31 in the list so each digit is 1 2 and 3 1 are added to get the sum 3 and 4. So now the list would have 3 4 as elements.

Now list = [18, 23, 35, 43, 51] is a list of 5 numbers. ascendList = sorted(list, key = DigitList)  statement has a sorted() method which takes two arguments i.e. the above list and a key which is equal to the DigitList which means that the list is sorted out using key=DigitList. DigitList simply converts each number of list to a another list with its digits as elements and then returns the sum of the digits. Now using DigitList method as key the element of the list = [18, 23, 35, 43, 51] are sorted using sorted() method. print(ascendList) statement prints the resultant list with values in the list in ascending order sorted by the sum of their digits.

So for the above list [18, 23, 35, 43, 51] the sum of each number is 9 ,5, 8, 7, 6 and then list is sorted according to the sum values in ascending order. So 5 is the smallest, then comes 6, 7, 8 and 9. So 5 is the sum of the number 23, 6 is the sum of 51, 7 is the sum of 43, 8 is the sum of 35 and 9 is the sum of 18. So now after sorting these numbers according to their sum the output list is:

[23, 51, 43, 35, 18]                                                                                                          

Driving is expensive. Write a program with a car's miles/gallon (as float), gas dollars/gallon (as float), the number of miles to drive (as int) as input, compute the cost for the trip, and output the cost for the trip. Miles/gallon, dollars/gallon, and cost are to be printed using two decimal places. Note: if milespergallon, dollarspergallon, milestodrive, and trip_cost are the variables in the program then the output can be achieved using the print statement: print('Cost to drive {:d} miles at {:f} mpg at $ {:.2f}/gallon is: $ {:.2f}'.format(milestodrive, milespergallon, dollarspergallon, trip_cost)) Ex: If the input is: 21.34 3.15

Answers

Answer:

milespergallon = float(input())

dollarspergallon = float(input())

milestodrive = int(input())

trip_cost = milestodrive / milespergallon * dollarspergallon

print('Cost to drive {:d} miles at {:f} mpg at $ {:.2f}/gallon is: $ {:.2f}'.format(milestodrive, milespergallon, dollarspergallon, trip_cost))

Explanation:

Get the inputs from the user for milespergallon, dollarspergallon and milestodrive

Calculate the trip_cost, divide the milestodrive by milespergallon to get the amount of gallons used. Then, multiply the result by dollarspergallon.

Print the result as requested in the question

Answer:

def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):

  gallon_used = driven_miles / miles_per_gallon

  cost = gallon_used * dollars_per_gallon  

  return cost  

miles_per_gallon = float(input(""))

dollars_per_gallon = float(input(""))

cost1 = driving_cost(10, miles_per_gallon, dollars_per_gallon)

cost2 = driving_cost(50, miles_per_gallon, dollars_per_gallon)

cost3 = driving_cost(400, miles_per_gallon, dollars_per_gallon)

print("%.2f" % cost1)

print("%.2f" % cost2)

print("%.2f" % cost3)

Explanation:

differentiate between web site and web application?

Answers

Explanation:

A website is a group of globally accessible into linked pages which have a single domain name. A web application is a software or program is is accessible using any web browser.

Answer:

Explanation:

A website shows static or dynamic data that is predominantly sent from the server to the user only, whereas a web application serves dynamic data with full two way interaction.

Write a program that read two numbers from user input. Then, print the sum of those numbers.

Answers

Answer:

#This is in Python

number1 = raw_input("Enter a number: ")

number2 = raw_input("Enter another number: ")

sum = float(number1) + float(number2)

print(sum)

Explanation:

A service provider recently upgraded one of the storage clusters that houses non-confidential data for clients. The storage provider wants the hard drives back in working condition. Which of the following is the BEST method for sanitizing the data given the circumstances?

a. Hashing
b. Wiping
c. Purging
d. Degaussing

Answers

Answer:

c. Purging

Explanation:

Based on the information provided it can be said that the best method for sanitizing the data would be Purging. This is a process that permanently erases the data from a specific storage unit. Doing so prevents data from being recovered by an expert and also frees up storage and memory space to be used for other information. Since it is very inexpensive and provides the best overall results this would be the best option in this scenario.

What are the pros and cons of using a linked implementation of a sparse matrix, as opposed to an array-based implementation?

Answers

Answer:

Linked lists and arrays are both linear data structures but while an array is a collection of items that can be accessed randomly, a linked list can be accessed sequentially.

A sparse matrix contains very few non-zero elements. For example;

_                        _

|  0   0   3  0  6    |

|   0   5   0  0  4   |

|   2   0   0  0  0   |

|_ 0   0   0  0  0 _|

In the implementation of a sparse matrix, the following are some of the pros and cons of using a linked list over an array;

PROS

i.  Linked lists are dynamic in nature and are readily flexible - they can expand and contract without having to allocate and/or de-allocated memory compared to an array where an initial size might need to be set and controlled almost manually. This makes it easy to store and remove elements from the sparse matrix.

ii. No memory wastage. Since the size of a linked list can grow or shrink at run time, there's no memory wastage as it adjusts depending on the number of items it wants to store. This is in contrast with arrays where you might have unallocated slots. Also, because the zeros of the sparse matrix need not be stored when using linked lists, memory is greatly conserved.

CONS

i. One of the biggest cons of linked lists is the difficulty in traversing items. With arrays, this is just of an order of 0(1) since the only requirement is the index of the item. With linked lists, traversal is sequential which means slow access time.

ii. Storage is another bottle neck when using linked lists in sparse matrix implementation. Each node item in a linked list contains other information that needs to be stored alongside the value such as the pointer to the next or previous item.

Define a function ComputeGasVolume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the gas equation PV = nRT, where P is pressure in Pascals, V is volume in cubic meters, n is number of moles, R is the gas constant 8.3144621 ( J / (mol*K)), and T is temperature in Kelvin.Sample program:#include const double GAS_CONST = 8.3144621;int main(void) { double gasPressure = 0.0; double gasMoles = 0.0; double gasTemperature = 0.0; double gasVolume = 0.0; gasPressure = 100; gasMoles = 1 ; gasTemperature = 273; gasVolume = ComputeGasVolume(gasPressure, gasTemperature, gasMoles); printf("Gas volume: %lf m^3\n", gasVolume); return 0;}

Answers

Answer:

double ComputeGasVolume(double pressure, double temperature, double moles){

   double volume = moles*GAS_CONST*temperature/pressure;

    return volume;        

}

Explanation:

You may insert this function just before your main function.

Create a function called ComputeGasVolume that takes three parameters, pressure, temperature, and moles

Using the given formula, PV = nRT, calculate the volume (V = nRT/P), and return it.

SONET is the standard describing optical signals over SMF, while SDH is the standard that describes optical signals over MMF fiber.
A. True
B. False

Answers

Answer:

False.

Explanation:

SONET is an acronym for synchronous optical networking while SDH is an acronym for synchronous digital hierarchy. They are both standard protocols used for the transmission of multiple digital bit streams (multiplex) synchronously through an optical fiber by using lasers.

Hence, both SONET and SDH are interoperable and typically the same standard protocols in telecommunication networks. Also, the SONET is a standardized protocol that is being used in the United States of America and Canada while SDH is an international standard protocols used in countries such as Japan, UK, Germany, Belgium etc.

The synchronous optical networking was developed in 1985 by Bellcore and it was standardized by the American National Standards Institute (ANSI). SDH was developed as a replacement for the plesiochronous digital hierarchy (PDH).

Generally, SONET comprises of four functional layers and these are;

1. Path layer

2. Line layer.

3. Section layer.

4. Physical or Photonic layer.

The SDH comprises of four synchronous transport modules and these are;

1. STM-1: having a basic data rate of 155.52Mbps.

2. STM-4: having a basic data rate of 622.08Mbps.

3. STM-16: having a basic data rate of 2488.32Mbps.

4. STM-64: it has a basic data rate of 9953.28Mbps.

These two standard telecommunications protocols are used to transmit large amounts of network data over a wide range through the use of an optical fiber.

k- Add the code to define a variable of type 'double', with the name 'cuboidVolume'. Calculate the volume of the cuboid and set this variable value.

Answers

Answer:

Here is the JAVA program to calculate volume of cuboid:

import java.util.Scanner; // Scanner class is used to take input from user

public class CuboidVol { // class to calculate volume of cuboid

public static void main(String[] args) { // start of main() function body

Scanner input= new Scanner(System.in); //create Scanner class object

// prompts user to enter length of cuboid

System.out.println("Enter the cuboid length:");

double length=input.nextDouble(); //reads the input length value from user

// prompts user to enter width of cuboid

System.out.println("Enter the cuboid width:");

double width=input.nextDouble(); //reads the input width from user

// prompts user to enter height of cuboid

System.out.println("Enter the cuboid height:");

double height=input.nextDouble(); //reads the input height from user

/* the following formula is to calculate volume of a cuboid by multiplying its length width and height and a double type variable cuboidVolume is defined to store the value of the resultant volume to it */

double  cuboidVolume= length*width*height; //calculates cuboid volume

//displays volume of cuboid and result is displayed up to 2 decimal places

System.out.printf("Volume of the cuboid (length " + length + "/ height " + height + "/ width" +width +" is: " + "%.2f",cuboidVolume);   } }

Explanation:

The formula for the volume of a cuboid is as following:

Volume = Length × Width ×  Height

So in order to calculate the volume of cuboid three variable are required for length, width and height and one more variable cuboidVolume to hold the resultant volume of the cuboid.

The program is well explained in the comments added to each statement of the program. The program prompts the user to enter the value of height width and length of cuboid and the nextDouble() method is used to take the double type input values of height length and width. Then the program declares a double type variable cuboidVolume to hold the result of the volume of cuboid. Then the last printf statement is used to display the volume of cuboid in the format format "Volume of the cuboid (length  / height  / width ) is" and the result is displayed up to 2 decimal places.

The screenshot of the program along with its output is attached.


Enter key is also known as Return key. (True or false)

Answers

Answer:

I think false

hope it helps

Answer:

False

Explanation:

The return key is the backspace or escape key.

Hope it helps.

The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?

Answers

Answer:

Deployment

Explanation:

Hardware lifecycle management is geared at making optimum use of the computer hardware so as to maximize all the possible benefits. During the deployment stage of the hardware lifecycle, the user is prompted by the computer to input their own computer hostname and username. In doing this, it is important that the user takes note of possible flaws in security. Passwords are set at this stage too. The four stages in the hardware lifecycle are procurement, deployment, maintenance, and retirement. At the deployment stage, the hardware is set up and allocated to employees so that they can discharge their duties effectively.

So, for organizations, it is important that strong passwords are used to prevent security breaches in the event that an employee leaves the organization.

Answer:

Deployment

Explanation:

When you are creating a certificate, which process does the certificate authority use to guarantee the authenticity of the certificate

Answers

Answer:

Verifying digital signature

Explanation:

In order to guarantee authenticity of digital messages an documents, the certificate authority will perform the verification of the digital signature. A valid digital signature indicates that data is coming from the proper server and it has not been altered in its course.

Step1: This file contains just a program shell in which you will write all the programming statements needed to complete the program described below. Here is a sample of the current contents of areas.cpp 1 // Assignment 5 is to compute the area (s) WRITE A COMMENT BRIEFLY DESCRIBING THE PROGRAM PUT YOUR NAME HERE. 2 3 4 // INCLUDE ANY NEEDED HEADER FILES HERE 5 using namespace std;l 7 int main) 9// DEFINE THE NAMED CONSTANT PI HERE AND SET ITS VALUE TO 3.14159 10 11 // DECLARE ALL NEEDED VARIABLES HERE. GIVE EACH ONE A DESCRIPTIVE 12// NAME AND AN APPROPRIATE DATA TYPE 13 14// WRITE STATEMENTS HERE TO DISPLAY THE 4 MENU CHOICES 15 16// WRITE A STATEMENT HERE TO INPUT THE USERS MENU CHOICE 17 18// WRITE STATEMENTS TO OBTAIN ANY NEEDED INPUT INFORMATION 19// AND COMPUTE AND DISPLAY THE AREA FOR EACH VALID MENU CHOICE 20 / IF AN INVALID MENU CHOICE WAS ENTERED, AN ERROR MESSAGE SHOULD 21 /BE DISPLAYED 23 return 0 24 )
Step 2: Design and implement the areas.cpp program so that it correctly meets the program specifications given below Specifications: Sample Run Program to calculate areas of objects Create a menu-driven program that finds and displays areas of 3 different objects. The menu should have the following 4 choices 1 -- square 2 circle 3 - right triangle 4 - quit 1square 2 -- circle 3 -- right triangle 4quit Radius of the circle: 3.0 Area 28.2743 . If the user selects choice 1, the program should find the area of a square . If the user selects choice 2, the program should . If the user selects choice 3, the program should . If the user selects choice 4, the program should . If the user selects anything else (i.e., an invalid find the area of a circle find the area of a right triangle quit without doing anything choice) an appropriate error message should be printed

Answers

Answer & Explanation:

This program is written in C++ and it combines the step 1 and step 2 to create a menu driven program

Each line makes use of comments (as explanation)

Also, see attachment for program file

Program Starts Here

//Put Your Name Here; e.g. MrRoyal

//This program calculates the area of circle, triangle and square; depending on the user selection

//The next line include necessary header file

#include<iostream>

using namespace std;

int main()

{

//The next line defines variable pi as a constant with float datatype

const float pi = 3.14159;

// The next two lines declares all variables that'll be needed in the program

string choice;

float length, base, height, radius, area;

// The next four lines gives an instruction to the user on how to make selection

cout<<"Press 1 to calculate area of a square: "<<endl;

cout<<"Press 2 to calculate area of a circle: "<<endl;

cout<<"Press 3 to calculate area of a triangle: "<<endl;

cout<<"Press 4 to quit: "<<endl;

//This  next line prompts user for input

cout<<"Your choice: ";

//This next line gets user input and uses it to determine the next point of execution

cin>>choice;

if(choice == "1")  //If user input is 1, then the choice is area of square

{

 cout<<"Length: ";  //This line prompts user for length of the square

 cin>>length;  // This line gets the length of the square

 area = length * length;  //This line calculates the area

 cout<<"Area: "<<area;  //This line prints the calculated area

}

else if(choice == "2") //If user input is 2, then the choice is area of circle

{

 cout<<"Radius: ";  //This line prompts user for radius

 cin>>radius;  //This line gets radius of the circle

 area = pi * radius * radius;  // This line calculates the area

 cout<<"Area: "<<area;  //This line prints the calculated area

}

else if(choice == "3") //If user input is 2, then the choice is area of triangle

{

 cout<<"Base: "; //This line prompts user for base

 cin>>base;  //This line gets the base

 cout<<"Height: ";  //This line prompts user for height

 cin>>height;  //This line gets the height

 area = 0.5 * base * height;  //This line calculates the area

 cout<<"Area: "<<area;  //This line prints the calculated area

}

else if(choice == "4")  //If user input is 4, then the choice is to quit

{

 //Do nothing and quit

}

else  //Any other input is invalid

{

 cout<<"Invalid Option Selected";

}

return 0;

}

Your boss wants you to start making your own Ethernet cables to save the company money. What type of connectors will you need to order to make them?

Answers

Answer:

Bulk Ethernet Cable - Category 5e or CAT5e

Bulk RJ45 Crimpable Connectors for CAT-5e

Explanation:

Write code to create a list of numbers from 0 to 67 and assign that list to the variable nums. Do not hard code the list. Save & RunLoad HistoryShow CodeLens

Answers

Answer:

The program written in Python is as follows

nums = []

for i in range(0,68):

-->nums.append(i)

print(nums)

Explanation:

Please note that --> is used to denote indentation

The first line creates an empty list

nums = []

This line creates an iteration from 0 to 67, using iterating variable i

for i in range(0,68):

This line saves the current value of variable i into the empty list

nums.append(i)

At this point, the list has been completely filled with 0 to 67

This line prints the list

print(nums)

in java how do i Write a method named isEven that accepts an int argument. The method should return true if the argument is even, or false otherwise. Also write a program to test your method.

Answers

Answer:============================================

//Class header definition

public class TestEven {

   

   //Method main to test the method isEven

   public static void main(String args[ ] ) {

       

       //Test the method isEven using numbers 5 and 6 as arguments

       System.out.println(isEven(5));

       System.out.println(isEven(6));

     

   }

   

   //Method isEven

   //Method has a return type of boolean since it returns true or false.

   //Method has an int parameter

   public static boolean isEven(int number){

       //A number is even if its modulus with 2 gives zero

      if (number % 2 == 0){

           return true;

       }

       

       //Otherwise, the number is odd

       return false;

   }

}

====================================================

Sample Output:

=========================================================

false

true

==========================================================

Explanation:

The above code has been written in Java. It contains comments explaining every part of the code. Please go through the comments in the code.

A sample output has also been provided. You can save the code as TestEven.java and run it on your machine.

Methods are collections of named program statements that are executed when called or evoked

The program in Java, where comments are used to explain each line is as follows:

import java.util.*;

public class Main {

   public static void main(String args[ ] ) {

       //This creates a Scanner Object

       Scanner input = new Scanner(System.in);

       //This gets input for the number

       int num = input.nextInt();

       //This calls the function

       System.out.println(isEven(num));

  }

  public static boolean isEven(int num){

      //This returns true, if num is even

      if (num % 2 == 0){

          return true;

      }

      //This returns false, if otherwise

      return false;

  }

}

Read more about methods at:

https://brainly.com/question/20442770

It is acceptable to create two TCP connections on the same server/port doublet from the same client with different port numbers.
A. True
B. False

Answers

the answer is a. true
I think the answer is A

24. Which of the following statements about Emergency Support Functions (ESFs) is correct?
O A. ESFs are not exclusively federal coordinating mechanism
O B. ESFs are only a state or local coordinating mechanism
O C. ESFs are exclusively a federal coordinating mechanism
O D. ESFs are exclusively a state coordinating mechanism

Answers

(ESFs) is correct: ESFs are not exclusively federal coordinating mechanism.

opearating system protection refers to a mechanism for controling access by programs, processes, or users to both system and user resources. briefly explain what must be done by the operating system protection mechanism in order to provide the required system protection

Answers

Answer:

The operating system must by the use of policies define access to and the use of all computer resources.

Policies are usually defined during the design of the system. These are usually default in settings. Others are defined and or modified during installation of the addon and or third-party software.

Computer Security Policies are used to exact the nature and use of an organisations computers systems. IT Policies are divided into 5 classes namely:

General PoliciesServer PoliciesVPN PoliciesBack-Up PoliciesFirewall Access and Configuration Policies

Cheers!

How many times will the while loop that follows be executed? var months = 5; var i = 1; while (i < months) { futureValue = futureValue * (1 + monthlyInterestRate); i = i+1; }
a. 5
b. 4
c. 6
d. 0

Answers

Answer:

I believe it is A

Explanation:

The famous Fibonacci sequence, 1, 1, 2, 3, 5, 8, 13, . . . , begins with two 1s. After that, each number is the sum of the preceding two numbers. Write a program using a recursive function that requests an integer n as input and then displays the nth number of the Fibonacci sequence.

Answers

Yo bro I just need help with you

Answer:

int recursiveFunction(int n) {

 

if (n == 0 || n == 1) {

 

 return n;

}

else {

 

 return recursiveFunction(n - 2) + recursiveFunction(n - 1);

}

Explanation:

ICMP
(a) is required to solve the NAT traversal problem
(b) is used in Traceroute
(c) has a new version for IPv6
(d) is used by Ping

Answers

Answer:

(b) is used in Traceroute

(d) is used by Ping

Explanation:

ICMP is the short form of Internet Control Message Protocol. It is a protocol used by networking devices such as routers to perform network diagnostics and management. Since it is a messaging protocol, it is used for sending network error messages and operations information. A typical message could be;

i. Requested service is not available

ii. Host could not be reached

ICMP does not use ports. Rather it uses types and codes. Some of the most common types are echo request and echo reply.

Traceroute - which is a diagnostic tool - uses some messages available in ICMP (such as Time Exceeded) to trace a network route.

Ping - which is an administrative tool for identifying whether a host is reachable or not - also uses ICMP. The ping sends ICMP echo request packets to the host and then waits for an ICMP echo reply from the host.

ICMP is not required to solve NAT traversal problem neither does it have a new version in IPV6.

12. Kelly would like to know the average bonus multiplier for the employees. In cell C11, create a formula using the AVERAGE function to find the average bonus multiplier (C7:C10).

Answers

Answer:

1. Divide each bonus by regular bonus apply this to all the data

2. In cell C11 write, "Average" press tab key on the keyboard and then select the range of the cells either by typing "C7:C10" or by selecting it through the mouse.

Explanation:

The average bonus multiplier can be found by dividing each bonus with the regular bonus applying this to all the data and then putting the average formula and applying it to the cells C7:C10.  

After dividing the bonus with regular bonus, in cell C11 write, "Average" press tab key on the keyboard and then select the range of the cells either by typing "C7:C10" or by selecting it through the mouse.

Distinguish among packet filtering firewalls, stateful inspection firewalls, and proxy firewalls. A thorough answer will require at least a paragraph for each type of firewall.
Acme Corporation wants to be sure employees surfing the web aren't victimized through drive-by downloads. Which type of firewall should Acme use? Explain why your answer is correct.

Answers

Answer:

packet filtering

Explanation:

We can use a packet filtering firewall, for something like this, reasons because when visiting a site these types of firewalls should block all incoming traffic and analyze each packet, before sending it to the user. So if the packet is coming from a malicious origin, we can then drop that packet and be on our day ;D

All of the following are examples of being computer literate, EXCEPT ________. knowing how to use the web efficiently knowing how to build and program computers knowing how to avoid hackers and viruses knowing how to maintain and troubleshoot your computer

Answers

Answer:knowing how to build and program computers.

Explanation:

Write a program that create Employee class with fields id,name and sal and create Employee object and store data and display that data.

Answers

Answer:

Here is the C++ program for Employee class with fields id,name and sal.

#include <iostream>  // to use input output functions

#include <string>  //to manipulate and use strings

using namespace std;   // to access objects like cin cout

class Employee {  //class Employee

private:  

/* the following data members are declared as private which means they can only be accessed by the functions within Employee class */

  string name;  //name field

  int id; //id field

  double sal;   //salary field

public:    

  Employee();  // constructor that initializes an object when it is created

/* setName, setID and setSalary are the mutators which are the methods used to change data members. This means they set the values of a private fields i.e. name, id and sal */

  void setName(string n)  //mutator for name field

     { name = n; }        

  void setId(int i)  //mutator for id field

     { id = i; }        

  void setSalary(double d)  //mutator for sal field

     { sal = d; }  

/* getName, getID and getSalary are the accessors which are the methods used to read data members. This means they get or access the values of a private fields i.e. name, id and sal */

  string getName()  //accessor for name field

     { return name; }        

  int getId()  //accessor for id field

     { return id; }        

  double getSalary()  //accessor for sal field

     { return sal; }  };  

Employee::Employee() {  //default constructor where the fields are initialized

  name = "";  // name field initialized

  id = 0;  // id field initialized to 0

  sal = 0;   }   // sal field initialized to 0

void display(Employee);  

// prototype of the method display() to display the data of Employee

int main() {  //start of the main() function body

  Employee emp;  //creates an object emp of Employee class

/*set the name field to Abc Xyz which means set the value of Employee class name field to Abc Xyz  through setName() method and object emp */

  emp.setName("Abc Xyz");  

/*set the id field to 1234 which means set the value of Employee class id field to 1234  through setId() method and object emp */

  emp.setId(1234);

/*set the sal field to 1000 which means set the value of Employee class sal field to 1000  through setSalary() method and object emp */

  emp.setSalary(1000);    

  display(emp);  }   //calls display() method to display the Employee data

void display(Employee e) {  // this method displays the data in the Employee //class object passed as a parameter.

/*displays the name of the Employee . This name is read or accessed through accessor method getName() and object e of Employee class */

  cout << "Name: " << e.getName() << endl;  

/*displays the id of the Employee . This id is read or accessed by accessor method getId() and object e */

  cout << "ID: " << e.getId() << endl;

/*displays the salary of the Employee . This sal field is read or accessed by accessor method getSalary() and object e */

  cout << "Salary: " << e.getSalary() << endl;  }

Explanation:

The program is well explained in the comments mentioned with each statement of the program.

The program has a class Employee which has private data members id, name and sal, a simple default constructor Employee(), mutatator methods setName, setId and setSalary to set the fields, acccessor method getName, getId and getSalary to get the fields values.

A function display( ) is used to display the Employee data i.e. name id and salary of Employee.

main() has an object emp of Employee class in order to use data fields and access functions defined in Employee class.

The output of the program is:

Name: Abc Xyz                                                                                                      

ID: 1234                                                                                                                  

Salary: 1000

The program and its output are attached.

A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long file names. Can something approximating a hierarchical file system be simulated? How?

Answers

Answer:

Yes

Explanation:

Yes, something approximating a hierarchical file system be simulated. This is done by assigning to each file name the name of the directory it is located in.

For example if the directory is UserStudentsLindaPublic, the name of the file can be UserStudentsLindaPublicFileY.

Also the file name can be assigned to look like the file path in the hierarchical file system. Example is /user/document/filename

You are in a rectangular maze organized in the form of M N cells/locations. You are starting at the upper left corner (grid location: (1; 1)) and you want to go to the lower right corner (grid location: (M;N)). From any location, you can move either to the right or to the bottom, or go diagonal. I.e., from (i; j) you can move to (i; j + 1) or (i + 1; j) or to (i+1; j +1). Cost of moving right or down is 2, while the cost of moving diagonally is 3. The grid has several cells that contain diamonds of whose value lies between 1 and 10. I.e, if you land in such cells you earn an amount that is equal to the value of the diamond in the cell. Your objective is to go from the start corner to the destination corner. Your prot along a path is the total value of the diamonds you picked minus the sum of the all the costs incurred along the path. Your goal is to nd a path that maximizes the prot. Write a dynamic programming algorithm to address the problem. Your algorithm must take a 2-d array representing the maze as input and outputs the maximum possible prot. Your algorithm need not output the path that gives the maximum possible prot. First write the recurrence relation to capture the maximum prot, explain the correctness of the recurrence relation. Design an algorithm based on the recurrence relation. State and derive the time bound of the algorithm. Your algorithm should not use recursion

Answers

Answer:

Following are the description of the given points:

Explanation:

A) The Multiple greedy approaches could exist, which could be to reach for the closest emergency diamond, and yet clearly we are going to miss some very essential routes in that case. So, it can make every argument quickly, and seek to demonstrate a reference case for that.

B) An approach to the evolutionary algorithm and its users are going to just have states M x N. But each state (i, j) indicates the absolute difference between the amount of the selected diamond and the amounts of the costs incurred.

DP(i, j) = DimondVal(i, j) + max ((DP(i, j-1)-2), (DP(i-1,j-1)-3))

DP(i, j) is a description of the state.

DimondVal(i, j) is the diamond value at (i j), 0 if there is no diamond available.

This states must calculate the states of M N  and it involves continuous-time for each State to determine. Therefore the amount of time of such an algo is going to be O(MN).

How to set up a simple peer-to-peer network using a star topology?

Answers

Answer:

The description including its scenario is listed throughout the explanation section below.

Explanation:

Star topology seems to be a LAN system under which all points are connected to a single cable link location, such as with a switch as well as a hub. Put it another way, Star topology is among the most commonly used network configurations.

Throughout this configuration or setup:

Each common network setups network unit, such as a firewall, switch, as well as computer. The main network computer serves as either a server as well as the peripheral system serves as just a client.
Other Questions
True or False: Computing interest using the sum-of-the-digits method allocates more interest at the beginning of a loan than at the end of the loan. A sample of a compound is made up of 57.53 g C, 3.45 g H, and 39.01 g F. Determine the empirical formula of this compound. ................................. Two teams are playing tug-of-war. Team A, on the left, is pulling on the rope with an effort of 5000 N. If the rope is moving at a constant velocity, how hard and in which direction is team B pulling? A. 2500 N to the left B. 5000 N to the right C. 2500 N to the rightD. 5000 N to the left Identify whether the relationship between a and b in the image below is complementary, linear pair/supplementary, adjacent, or vertical. PLZ HELP!!! 20 POINTS how many solutions does this system have? x minus 3 y = 4. Negative 2 x + 6 y = 3. one two an infinite number no solution Find the missing length indicated. 4. A build-your-pasta restaurant charges a flat fee of $2.50 for pasta and $0.75 per ingredient. How muchdoes the pasta cost for 4 ingredients?y =IThe pasta plate will cost $ PLEASE HELP!!! You want to distribute 7 candies to 4 kids. If every kid must receive at least one candy, in how many ways can you do this? (it's not 15) 1.60 mL of a suspension of 320.0 mg/5.00 mL aluminum hydroxide isadded to 2.80 mL of hydrochloric acid. What is the molarity of thehydrochloric acid? Years ago, a bond was issued at par with a 7% coupon. This year, new issue bonds of similar credit quality are being issued at 10%. Which statement is TRUE Determine what type of study is described. Explain. Researchers wanted to determine whether there was an association between high blood pressure and the suppression of emotions. The researchers looked at 1800 adults enrolled in a Health Initiative Observational Study. Each person was interviewed and asked about their response to emotions. In particular they were asked whether their tendency was to express or to hold in anger and other emotions. The degree of suppression of emotions was rated on a scale of 1 to 10. Each person's blood pressure was also measured. The researchers analyzed the results to determine whether there was an association between high blood pressure and the suppression of emotions. Michelle highlighted this sentence in her favorite Western paperback novel: The bandit weaseled his way through the throng of women in hoop skirts and petticoats, making it nearly impossible for the sheriff and his posse to catch him before he hopped on the train. How does the word weaseled contribute to the tone of the sentence? A It shows the authors sympathy for the bandit. B It shows the authors disdain for the bandit and his actions. C It provides a concrete description of the bandits appearance. D It provides a point of comparison so the reader can better understand the bandit. Which of the following was a physical symbol of the split between the United States and the Soviet Union during the ColdWar? Identifico el nombre de la propiedad a la que hacen referencia las siguientes expresiones: Windsor Corporation has retained earnings of $702,500 at January 1, 2017. Net income during 2017 was $1,426,500, and cash dividends declared and paid during 2017 totaled $83,200. Prepare a retained earnings statement for the year ended December 31, 2017. Assume an error was discovered: land costing $89,590 (net of tax) was charged to maintenance and repairs expense in 2014. (List items that increase retained earnings first.) PART 1which organelle is labeled A?a. nucleusb. vacuolec. ribosome d. mitochondrionPART 2which organelle is labeled E?a. golgi apparatusb. chloroplastc. ribosomed. nucleusPART 3which organelle is labeled I?a. nucleus b. mitochondrion c. ribosome d. chloroplastPART 4which organelle is labeled G?a. cytoplasmb. cell wallc. cell membraned. vacuole 9 A skier travelling in a straight line up a hill experiences a constant deceleration.At the bottom of the hill, the skier has a speed of 16ms- and, after moving upthe hill for 40 s, he comes to rest. Find:a the deceleration of the skierb the distance from the bottom of the hill to the point where the skier comes to rest. about student for five sentence brainstorming ideas? graph y=8 sec1/5 the answers are graphs I am just unsure of how to answer