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
Amanda [17]
4 years ago
6

(a) Rewrite the following using if else statement:

Computers and Technology
1 answer:
Yakvenalex [24]4 years ago
5 0

Answer:

int x;

String s;

if ((x%3) == 0) {

   s = "Divisible by 3";

} else {

  s = "Not divisible by 3";

}

System.out.println(s);​

Explanation:

A : B ? C generally translates to if (A) { B } else { C }.

Note the == to compare to 0. The single = in the original expression is a mistake.

You might be interested in
How do I cite a website?
Mila [183]

Last, First M. “Article Title.”Website Title. Website Publisher, Date Month Year Published. Web. Date Month Year Accessed.


3 0
4 years ago
Read 2 more answers
When a policy setting in Computer Configuration and User Configuration in the same GPO conflict, the Computer Configuration poli
Maru [420]

Answer:

True

Explanation:

Computer Configuration policy applied first. This happens when the Computer system boots up. Then the user policy is applied when the user logs on. This takes place when the user object is in the same organizational unit.

So Computer Config policy setting takes precedence. User configurations is applied to local users only while computer configuration is applied to the machine itself. First the Computer GPO is applied and then the User GPO.  Loopback processing in replace mode enforces the Computer GPO over the user GPO.

8 0
4 years ago
What is the final value of the string output given the following code fragment? int counter = 0; int num = 0; string output = ""
swat32

int counter = 0;

int num = 0;

string output = "";

while (counter < 3) {

num = num * 1;

counter = counter + 1; }

output = Convert.ToString(num);

Output:

Counter = 0

num = 0 * 1 - - > num = 0

Counter = 1

num = 0 * 1 - - > num = 0

Counter = 2

num = 0 * 1 - - > num = 0

Counter = 3 (break)

num = 0

output = "0"

3 0
4 years ago
What is the difference between auto fill and fill handle ?​
lidiya [134]

Answer:

  • Auto fill a software function that automatically completes data (like the data that has been entered previously) without the user needing to type it in full.

  • The Fill Handle is a feature in Excel that fills the data automatically with a specific pattern in your spreadsheet cell.

hope u liked the answer :)

7 0
3 years ago
Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
MA_775_DIABLO [31]

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    const int NUM_VALS = 4;
  6.    int hourlyTemp[NUM_VALS];
  7.    int i;
  8.    
  9.    for (i = 0; i < NUM_VALS; ++i)
  10.    {
  11.        cin >> hourlyTemp[i];
  12.        
  13.    }
  14.    
  15.    /* Your solution goes here */
  16.    for(i = 0; i < NUM_VALS; ++i){
  17.        
  18.        if(i < NUM_VALS -1){
  19.            cout<<hourlyTemp[i]<<",";
  20.        }
  21.        else{
  22.            cout<<hourlyTemp[i];
  23.        }
  24.    }
  25.    cout << endl;
  26.    return 0;
  27. }

Explanation:

The solution code is given from Line 18 - 26. To print the element from array one after another, we create a for loop to traverse through every element in the array (Line 18). Create an if condition to check if the current index i is not the last index, print the element followed with a comma (Line 20 -22). Otherwise print only the element (Line 23 - 25).

8 0
3 years ago
Other questions:
  • A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
    9·1 answer
  • Which computer device works like the human central nervous system by connecting all the computer’s parts together and allowing t
    9·1 answer
  • Is there a way to search your computer for all music files on it?
    9·1 answer
  • Which is the correct formula to add the values in cells A1 and B1? A. SUM(A1+B1) B. =SUM(A1+B1) C. =SUMA1+B1 D. A1+B1
    9·2 answers
  • ​In sql server, the cursor property ____________________ means that the cursor is used for retrieval purposes only.
    9·1 answer
  • A 1400 kilogram car is moving at a speed of 25 m/s. How much kinetic energy does the car have?
    15·2 answers
  • To comply with ATC instructions for altitude changes of more than 1,000 feet, what rate of climb or descent should be used?
    5·1 answer
  • Assume the availability of an existing class, ICalculator, that models an integer arithmetic calculator and contains:an instance
    12·1 answer
  • How ssd is better than normal sata and pata HDD​
    11·1 answer
  • How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!