(TCO 4) What will the following program segment display? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1) { funny = 0; serious = 0; } else if (funny == 2) { funny = 10; serious = 10; } else { funny = 3; serious = 3; } cout << funny << " " << serious << endl; }

Answers

Answer 1

Answer:

3 3

Explanation:

The operator modulus '%' is gives the reminder of the number.

for example:

7%2  it gives the result 1 because 1 is reminder after divided by 2.

Initially the value of funny is 7 and serious is 15.

then, 15 is modulus by 2 which gives 1 and it store in the funny.

After that, if else statement check for condition.  

funny != 1  this condition is FALSE because Funny is equal to 1.

it moves to else if part Funny == 2 condition again FALSE it then move to else part and execute the statement Funny contain 3 and serious contain 3.

and then display.

Therefore, the answer 3 3.

Answer 2

Answer:

It'll be 3 3. Just because i think it is, duh

Explanation:


Related Questions

A ____ is a text document written in HTML.
Answer
Web browser
Web page
Web server
Web site

Answers

Answer:

Web page

Explanation:

A Web page represents content formatted in HyperText Markup Language ( HTML). Web Browsers like internet explorer,firefox or google chrome can interpret this content and display the page as specified in the markup. If we access any webpage on the browser and view its source we can see the HTML content underlying the webpage.

An abstract method ____.

is any method inthe abstract class
cannot beinherited
has nobody
is found in asubclass and overrides methods in a superclass using the reservedword abstract

Answers

Answer:

has no body.

Explanation:

An abstract method is a method which has no body.

It is contained in a class which is marked as abstract.

The implementation of such method is specified in a subclass.

For example:

//abstract class

abstract class myClass{

  /* Abstract method */  

  public abstract void mymethod(int a, int b);

}

//Concrete class extending abstract class

class Concrete extends myClass{

  public void mymethod(int a, int b){

return a+b;

  }

}

DASD stands for ____________? Direct access storage device? Direct application storage device? Diverse access storage device

Answers

Direct Access Storage Device

Answer:

Direct access storage device.

Explanation:

DASD stands for direct access storage device.

Trailer is only added at ___________ layer of OSI model.

a. Data link layer

b. Physical layer

c. Network layer

d. Transport layer

Answers

Answer:

a. Data link layer

Explanation:

A trailer / footer is the additional data (metadata) which is positioned at the end of the data block being stored or transferred,it  may contain information for the processing of the data block or simply placed at the end of the block.

In data transmission, the data is called the payload or body after the end of the header and before the trailer starts.

In Data link layer, it contain three parts-

Frame headerFrame dataFrame footer    

The MOVZX instruction can be used only with_____________ integers.

Answers

Answer: The MOVZX instruction can be used only with unsigned integers.

Explanation:

The MOVZX instruction allows to move a value from a smaller source to larger source ,by the method of padding it focuses on the most significant bits of the targets with zeroes . The destination for MOVZX should be a register only.  MOVZX cannot be used with any other type of integer such as signed integer etc except for that it can be used with unsigned integers only.

Relational DBMS are unable tostore multimedia objects. Does it underestimate RDBMS importance inreal world?

Answers

Answer:

 It may underestimate the importance of RDBMS in real world as, database system for storing the multimedia object images and images,consequently the objects and operation become more complex that is why, it is degrading the performance of the application in RDBMS. It is also dependence on the structure query language as, it is comparatively simple query optimization and unable to handle complex applications.

A relational database is a combination of many relation in the form of two dimensional table of rows and the columns containing tuples. The rows are called as records and the columns are called as attributes.

The true or false questions.

If find is run with no -exec option, then find will not take any action on the found files and there is no output to screen.

Answers

Answer:

false

Explanation:

-exec option is not mandatory for the find command.

find will still list out the identified files even in the absence of -exec option.

For example:

find . -name test -print

will print out files with the name 'test' in the current directory. Note that there is no exec option in this example.

Same holds true for find with no additional options at all.

For example:

find .

will list out all files in the current directory.

Compare and contrast the role that business users play when software is developed using Waterfall and Agile software development methodologies.

Answers

Answer: Both Agile and waterfall model are software development models to deliver a final outcome in the form of a software product. Waterfall model is sequential process with the requirements beings rigid and defined before beginning the software development.

Agile method basically  concerned with the requirements of the client. Here both testing and development is carried out at the same time.

Explanation:

More differences between the two include :

Waterfall model is easy to manage whereas in agile model as the the client requirements changes and wants more functionalities is becomes a bit more difficult to manage. the role of project manager is very crucial in waterfall model whereas the role of developers ans testers is more important in Agile model.

True or False and WHY:
Constructors can have names different from theirclasses.

Answers

Answer:

False

Explanation:

Constructors have to have the same name as their classes for proper syntax, if their names are different it will result in an error. Methods contained within the class can/should have different names, it is allowed because methods require return types while constructors cannot have return types.

How to write a Cprogram to print all the prime numbers between 1and n where n is the value supplied by the users.

Answers

Answer:

#include <stdio.h>

int main()

{

   int i, j, n, prime;

   printf("Enter till where we want to find prime number: ");

   scanf("%d", &n);

   for(i=2; i<=n; i++)

   {

       prime = 1;  

       for(j=2; j<=i/2; j++)

       {

         

           if(i%j==0)

           {

               prime = 0;

               break;

           }

       }

       if(prime==1)

       {

           printf("%d, ", i);

       }

   }

   return 0;

Explanation:

A number  which is divisible by 1 and itself is called prime number. Here in the program we start by taking number from 1 to n , where n is the last number till which we are required to find prime numbers. Then we start the loop by taking two for loops one for running the numbers from 1 to n and the inner for loop to check whether the number is divisible other than 1 and itself. We take the current number as prime =1. If the number is still not divisible by number other than 1 and itself we consider that number to be prime and print it.

Which of the following is the correctsyntax for commenting in Java?# Enter CommentsHere/* EnterComments Here*/** Enter CommentsHere **

Answers

Answer:

/* EnterComments Here*/

Explanation:

/* EnterComments Here*/   is the right syntax for comments in java.

we can use double farword slash (//)  for single line comment and for mutliple line we can use /* comments here */ and for documentation comment we use below syntax-

/**

*

*

*/

Write the sum of products, the canonical product of sums, theminterm shorthand and the maxterm shorthand for the following:

F(A,B,C) = A'B'+ AB'C + A'B'C'

Answers

Answer:

SOP=AB'+B'C

POS=B'(A'+C)

Shorthand Minterms=m₀+m₁+m₅

Shorthand Maxterms=M₃+M₂+M₄+M₆+M₇

Explanation:

For the full explanation of this question refer to the image attached which is of the k-Map of F.As we can see in the k-map that there are only 3 ones.by making 2 pairs of 1 we get the SOP expression.

Rest of them are zero from there we will get the POS expression.

The one's in the k-map represent the Minterms and 0's represent Maxterms and the number written in the box is their respective minterm and maxterm number.Minterms are represented by m and maxterms are represented by M.

What does the following function return? double compute speed(double distance); A. a double B. distance C. an integer D. nothing

Answers

Answer:

A. a double

Explanation:

The syntax of the function is:

type name( argument_1, argument_1,...... )

{  

    statement;

}

In the above syntax "type" define the return type of the function.

for example:

int count( int n);

so, it return the integer. Because the return type is 'int'.

In the question,

double compute speed(double distance);

Here, the return type is double. So, it return double.

The collection of all component frequencies iscalled _____________

a. Frequency Spectrum

b. Bandwidth

c. Throughput

d. None of the given

Answers

Answer:

The answer is Frequency Spectrum.

Explanation:

The frequency spectrum is range of all component frequencies.It contains all the waves which are as following:-

Gamma Rays

X-Rays

Ultraviolet

Visible light.

Infrared

Micro wave

Radio wave

These all waves have their range of frequencies.The waves that are visible to us is only the visible light.

How would a static local variable be useful?

Answers

Answer: Static local variable is a variable that is initialized as static only one time inside a function and whenever it is called in that function it will be accessible.

Explanation: Static local variables are very useful variables which are declared as static in a particular function. Static local variable is initialized only one time in a function and whenever the function in which it has been declared ,the value of the variable will be accessible by as many times it has been called in the function in which it is declared.

.Compositionally designed systems have the followingcharacteristics except:
A.dynamic definition B.classes built from componentclasses C.encapsulation D.white-box reuse

Answers

Answer: C) encapsulation

Explanation:

 As, encapsulation is the process by which the data is included from the protocol of the upper layer into lower layer of the protocol in the computer networking. Basically, in the networking it is the method of abstraction, as it allowed different functions by adding different layer. In encapsulation, the IP encapsulated packet are sent over the data link layers protocol for example ethernet.

The height of building A is 210 m and the height of building B is 350 m. The two are 240 m away from each other. How long should a ladder be for a person to go from the top of A to the top of B.

Answers

Answer:

The length of the ladder should be 277.85 meters long

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

I have created an illustration and attached it as a photo below to better help you understand the situation. As seen on the illustration the difference in height of Building B from Building A is,

[tex]350m-210m = 140m[/tex]

Now that we have the difference we need to find the length of the ladder which is the hypotenuse between the two buildings. We can calculate this by using the Pythagorean theorem which is the following

[tex]h^{2} = a^{2} +b^{2}[/tex]

Now we can plug in the values and solve for the hypotenuse (h)

[tex]h^{2} = 240^{2} +140^{2}[/tex]

[tex]h^{2} = 57,600 +19,600[/tex]

[tex]h^{2} = 77,200[/tex] ... square root of 77,200

[tex]h = 277.85m[/tex] .... rounded up

Therefore, the length of the ladder should be 277.85 meters long

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

A while loop is somewhat limited, because the counter can only be incremented by one each time through the loop.



True False

Answers

Answer:

False

Explanation:

In a while loop we can increment the counter by any number that we wish. It is not that the counter can only be incremented by one each time through the loop.

Below is an example of a while loop with counter incremented by 5 each time.

int count=0;    //initialize count to 0

while(count<50){    //continue the loop till count is lesser than 50

  cout<<count;   //display the value of count

  count = count + 5;    //increment counter by 5 each time

}

Final answer:

The statement is false; a while loop can increment a counter by any amount based on the code within the loop's body.

Explanation:

The statement that a while loop is limited because the counter can only be incremented by one each time through the loop is false. In programming, a while loop can be used to increment or alter a counter variable by any amount, as dictated by the statements within the loop's body. The control of a while loop is based on a condition, and as long as the condition remains true, the loop will continue to execute.

For example:

int counter = 0;
while (counter < 10) {
   counter += 2; // Increment counter by 2
}

In this example, the counter variable starts at 0 and increases by 2 on each iteration of the loop. You can increment the counter by any number, or even apply other operations to change its value in complex ways.

If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements?list1.size()list1.numElementslist1.lengthlist1.contains

Answers

Answer:

list1.size()

Explanation:

In order to find the number of elements in a List , we can use the size() method defined in the java.util.List interface.

This method returns an integer which corresponds to the number of elements in the list.

The usage syntax example is as follows:

int num = list1.size();

If the list referenced by list1 contains 6 elements, then this method will return the value 6.

When a function accepts multiple arguments, does it matter in what order the arguments

are passed?

Answers

Answer:

yes, it matter in what order the arguments  are passed.

Explanation:

when we define the function in the programming, you have to call the function as well.

In the calling function, we passed the arguments.

In the define function, parameters in declare for taking a copy of the arguments.

for example:

int print(int value, double price, char a){

    statement;

}

//calling

print(5, 7.8, 'a');

So, in the calling function the order of the argument changed, it gives the compile error.

because 5 is the integer, so you have to store in the int parameter.

print(7.8, 5, 'a'): if we try to do that, 7.8 which is double store in the wrong integer parameter, it gives the wrong output.

similarly, if we define the array in the parameter and pass the integer in the argument on the same location. it gives the compile error.

Therefore, the location must be the same.

Briefly explain the key points(including benefits/drawbacks) about the Water Fall life-cycle
model.

Answers

Answer:

The water fall life cycle model is explained as:

The waterfall life cycle model is defined as a sequential designed process in which progress are flowing steadily downwards through the process of analysis, design, testing and maintenance. It is the process of managing the development when something is complex.

Benefits:

It is a top down approach which breaks the tasks into a series of necessary goals that can important in the development process.Easy to maintain and use this approach. It can be easy to manage each phase has specific outputs and review process.

Drawbacks:

It takes a lot of time to properly document a system.The requirements cannot be changed in any phase.Risk and uncertainty are higher in this case.

What is the comment marker in Python? ("character marker" means the sequence of characters that indicates the beginning of a comment.)

Answers

Answer:

The # marker is used to mark a line comment in python.

Explanation:

The line that starts with # is a comment.Python will ignore the lines that starts with #.These comments can be used to add extra information in the python code.

For example:-

Following is the python code with comments.

names=['sam','optimus','bumblebee'] #names is the list of transformers characters.

for i in names:

     print(i)  #printing the names.

There are 2 comments in the python code written above.These are ignored by python.

Data Analysis The Iris Plants Database contains 3 classes of 50 instances each, where each class refers to a type of Iris plant. Five attributes/features were collected for each plant instance. 1. Implement an algorithm to read in the Iris dataset.

Answers

Answer:

35

Explanation:

The statement ____ declares intList to be a vector and the component type to be int

A.
vector intList;

B.
int.vector intList;

C.
int.vector intList;

Answers

Answer: vector<int> intList

Explanation:

Using the above declaration we can declare intList to be a vector and the component type to be int.

example:

int main()

{

vector<int> intList

   intList.push_back(1);                          

   intList.push_back(2);                          

   intList.push_back(3);                        

   printList(intList);  // printing the list

}

How to find IPaddress for DSL modem

Answers

Explanation:

The DSL modem has it's own IP address. We can use the windows command prompt tool to find the IP address for the DSL modem.

Below are the steps to find IP address for DSL modem:-

1. At first we need to hit the Windows Start button

2. Then type "cmd" in the Search box and press the Enter key to open the command prompt.

3. At the command prompt, type "ipconfig /all" and press the Enter key to run the command.

4. Focus on the Default Gateway value. The IP address mentioned for the Default Gateway is actually  the IP address for the DSL modem.

Using static arrays, depending on the number of servers specified by the user, a list of servers is created during program execution.

True

False

Answers

Answer:

False

Explanation:

Static arrays are stored on the stack , having fixed size and scope within functions.

Example-

               int arr[10];

Static arrays can't update the values given by the user at the time of execution, they are initialized with some default values.So,we can't create list of servers at the time of program execution.  

But we can create list of servers using Dynamic arrays, because size is not fixed as it stores in heap and update at the time of execution.  

Example-  

              int* arr = new int[10];

              delete[] arr;

Convert the following do-while loop to a while loop: char sure; do { cout << "Are you sure you want to quit? "; cin >> sure; }while (sure != 'Y' && sure != 'N');

Answers

Answer:

char sure;

   cout << "Are you sure you want to quit? ";

   cin >> sure;

   while (sure != 'Y' && sure != 'N'){

       cout << "Are you sure you want to quit? ";

       cin >> sure;

   }

Explanation:

The loop is used in the programming for executing the part of code or statement again and again until the condition is not false.

do-while is the loop statement but it has a special property, it prints the statement first then checks the condition.

So, the loop executes the statement once, if the condition is false in the starting.

In the other loops, condition checks first and then execute the statement accordingly.

To change the do-while to while, we write the statement once outside of the loop in the starting then execute the loop and put the same statement inside the loop and it runs again until the condition true.

After the above change, while loop works the same as do-while.

Why we called COBOL as a professional language and not ataught language.(

Answers

Answer:

COBOL(Common Business-Oriented Language)

COBOL was designed in industries such as finance and human resources for business computer programs. COBOL uses English syntax which make it easier for ordinary business users to understand computer programming languages.

COBOL is used to develop applications for businesses. We can say it is not a taught language because we don't learn it as teaching tool ,we use it in practical applications.

Which would be the best user error message?

A) Invalid Parameter
B) You must type a user name to continue.
C) You enter a user name to continue.
D) Gotcha! Type in a your user name.
E) Point the cursor on the user name and type one, please.

Answers

Answer: B. You must type a username to continue.

Explanation: "you must type a username to continue" is the most suitable error message of all the options given because it is the appropriate way and user-friendly approach to the user for correcting the error as compared to other options which consist of inappropriate words ,slang language or lengthy message which is not easily understood by the user.

Create a Java static method named getAverageOfFours that takes an array of integers as a parameter and returns the average of the values in the array that are evenly divisible by 4. Your method must work for an int array of any size. Example: If the array contains [10, 48, 16, 99, 84, 85], the method would return 49.33333.

Answers

Answer:

public class average{

   

   public static float getAverageOfFours(int[] arr){

       

       int n = arr.length;

       float sum = 0;

       int count=0;

       for(int i=0;i<n;i++){

           if(arr[i]%4==0){

               sum = sum+arr[i];

               count++;

           }

       }

       float avg = sum/count;

       return avg;

       

   }

    public static void main(String []args){

       

        int[] array = {10, 48, 16, 99, 84, 85};

       

        float result = getAverageOfFours(array);

        System.out.println("The average is "+result);

    }

}

Explanation:

Create the function with one parameter and return type is float.

Declare the variable and store the size of array. Take a for loop for traversing in the array and and check the element is divisible by 4 or not by using if statement. If condition true take the sum and increment the count.

This process continue until the condition is true.

finally take the average and return it.

Create the main function for calling the function with pass the array as argument and also define the array.

After that print the result return by the function.

Other Questions
The people of __________ are known for creating intricately decorated eggs called pysanky. A. Finland B. Germany C. Spain D. Ukraine b(n)=1(2)^n-1 What is the fourth term in the sequence? A gear pump has a 4.25in outside diameter, a 3.25in inside diameter, and a 2in width. If the actual pump flow rate is 1800rpm and rated pressure is 29gpm, what is the volumetric efficiency? what is the inverse operation of F(x)=2x+3 apex learning:Antibiotics destroy a bacterial infection by disabling ribosomes in the bacteria. Eukaryotic cells contain mitochondria that themselves contain ribosomes while bacterial cells have no organelles and thus have uncontained ribosomes. How do chemists use this fact to create antibiotics that can destroy a bacterial infection without harming human cells? the radius of Earth is 6400 km. the distance of the moon from the Earth's surface is 380000 km. find the radius of the moon which subtends an angle of 20'at the centre of the earth An example of a skeletal muscle working occurs when a person __________. A.perspires heavilyB.digests foodC.takes a breathD.stands upPlease select the best answer from the choices provided.ABCD Determine the slant asymptote for the function f(x)=3x^2-4x + 5/ x-3 William has noticed that his daughter Bonnie has recently begun to ask a lot of questions like, What can I be when I grow up? and How come the sky is blue? This behavior is best associated with the ____ stage of development. Help with this question thanks Rewrite the polynomial 4x^2-7x^3-x^6+3x^4-1 in descending order, using coefficients of 0 for any missingterms.Which term is first second third, etc., when the polynomial is written in this way?Match the term number to the appropriate term.Term 7Select an optionTerm 6Select an optionTerm 5Select an optionTerm 4Select an optionTerm 3Select an optionTerm 2Select an optionTerm 1Select an optio Bunny Bread Company manufactures different types of bread and accounts for its production using an ABC costing system. It has a 5,000-square-foot factory space that it rents for $2,500 a month for all its manufacturing activities. Bunny Bread has identified its activities as follows: preparation and setup, kneading, baking, packaging, and quality control. Two thousand five hundred (2,500) square feet of the factory are used for kneading, while 750 square feet (each) are used for preparation and setup and quality control. Baking and packaging use 500 square feet each. When assigning indirect costs to each activity, how much factory rent should be assigned to the preparation and setup cost pool? Drag the tiles to the correct boxes to complete the pairs. Not all tiles will be used. Multiple Choice:The continents are light in color because they contain:A. silicon and aluminumb.iron and nickelc.iron and quartzd.silicon and magnesium 3.Determine the angle PMA of the lampshade.15 cm-25 cm-25 cm.-M a gross of baseball cards contains 144 packs of cards. each pack contains 8 baseball cards how many cards do you have in all? Which event takes place during anaphase II of meiosis II?a. Sister chromatids separate.b. Cytoplasm divides.c. Spindle fibers disassemble.d. Nuclear membrane breaks down. The quotient of 6 cubed and 4 squared Write the equation of the line that passes though (-3,5) and (2,10) in slope intercept form A car is rounding an unbanked circular turn with a speed of v = 35 m/s. The radius of the turn is r = 1500 m. What is the magnitude ac of the cars centripetal acceleration?