1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
WITCHER [35]
3 years ago
14

(TCO 4) What will the following program segment display? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1) { fun

ny = 0; serious = 0; } else if (funny == 2) { funny = 10; serious = 10; } else { funny = 3; serious = 3; } cout << funny << " " << serious << endl; }
Computers and Technology
2 answers:
katen-ka-za [31]3 years ago
7 0

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.

Mazyrski [523]3 years ago
5 0

Answer:

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

Explanation:

You might be interested in
Create a flowchart that assigns a counselor to a student.
Nataly [62]
Please Help! Unit 6: Lesson 1 - Coding Activity 2
Instructions: Hemachandra numbers (more commonly known as Fibonacci numbers) are found by starting with two numbers then finding the next number by adding the previous two numbers together. The most common starting numbers are 0 and 1 giving the numbers 0, 1, 1, 2, 3, 5...
The main method from this class contains code which is intended to fill an array of length 10 with these Hemachandra numbers, then print the value of the number in the array at the index entered by the user. For example if the user inputs 3 then the program should output 2, while if the user inputs 6 then the program should output 8. Debug this code so it works as intended.

The Code Given:

import java.util.Scanner;

public class U6_L1_Activity_Two{
public static void main(String[] args){
int[h] = new int[10];
0 = h[0];
1 = h[1];
h[2] = h[0] + h[1];
h[3] = h[1] + h[2];
h[4] = h[2] + h[3];
h[5] = h[3] + h[4];
h[6] = h[4] + h[5];
h[7] = h[5] + h[6];
h[8] = h[6] + h[7]
h[9] = h[7] + h[8];
h[10] = h[8] + h[9];
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
if (i >= 0 && i < 10)
System.out.println(h(i));
}
}
4 0
3 years ago
Read 2 more answers
A consumer-directed digital or computer device that has a video output signal for displaying a video game is called a .......
Allushta [10]
I think the first problem is B. and the second problem is D.
4 0
4 years ago
How do you make a ringtone on earsketch
RoseWind [281]

Haven't used earsketch, but here we go.

Answer:

1). Make a track in earsketch, make it like 6/7 seconds

2.) export your track as an .mp3, .wav, or  .ogg (your choice!)

3.) (If on android) Navigate to settings, now search for an entry for ringtone.

4.) If you have no luck, look up how to set ringtone on your desired phone brand (iOS, Android, etc.)

5.) Test out your new ringtone

6.)Profit

4 0
3 years ago
You are troubleshooting network connectivity issues on a workstation. Which command would you use to request new IP configuratio
kolezko [41]

Answer:

ipconfig / release command will be used to request new IP configuration information from a DHCP server

Explanation:

The ipconfig /release sends a DHCP release notification to the client so that the client immediately releases the lease henceforth updating the server's status information . This command also mark the old client's id as being available. Thus, the command ipconfig /renew then request a new IP address.

4 0
3 years ago
Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Marianna [84]

Answer:

hello

Explanation:

how are you?

7 0
3 years ago
Other questions:
  • You want to create a set of instructions to teach your dog to walk, to bark on command, and to heel. Such software would similar
    6·1 answer
  • What allows windows to quickly be resized by clicking the title bar of the window and dragging it to the top, sides, or middle o
    9·1 answer
  • 7d2b:00a9:a0c4:0000:a772:00fd:a523:0358
    12·1 answer
  • When you cut and then paste a file, what are you doing?
    7·2 answers
  • A customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft P
    9·1 answer
  • A Hospital wants to store different types of data I need to find the best storage device for each type and why what is the best
    14·1 answer
  • Suppose a package pkg1 contains a class named MyClass and another package pkg2 contains a different class named MyClass. What ha
    13·1 answer
  • Use the drop-down menus to match each description to its corresponding term.
    7·1 answer
  • Which securities protect data through processes, procedures,decisions,and user pernissions. Determines where and how data can be
    13·1 answer
  • List out the input and output device .​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!