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
AfilCa [17]
3 years ago
8

Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUser

s. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7. Hint: Start with "numUsers = ...".
Sample program:

#include

int main(void) {
int numUsers = 0;
int updateDirection = 0;

numUsers = 8;
updateDirection = 1;



printf("New value is: %d\n", numUsers);

return 0;
}
Computers and Technology
1 answer:
jeyben [28]3 years ago
3 0

Answer:

if(updateDirection==1){

   numUsers++;

}

else if(updateDirection==0){

   numUsers--;

}

Explanation:

The if and else if conditional statement above accomplishes this.

if the first condition is true (updateDirection==1), numUsers is increemented by 1 (numUsers++)

else if the second condition is true (updateDirection==0), numUsers is decreemented by 1 (numUsers--)

See a complete C++ code below:

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>int numUsers = 0;</em>

<em>int updateDirection = 0;</em>

<em />

<em>numUsers = 8;</em>

<em>updateDirection = 0;</em>

<em />

<em>if(updateDirection==1){</em>

<em>    numUsers++;</em>

<em>}</em>

<em>else if(updateDirection==0){</em>

<em>    numUsers--;</em>

<em>}</em>

<em>cout<<"New value is: "<< numUsers<<endl;</em>

<em>return 0;</em>

<em>}</em>

You might be interested in
BRAINLIEST !!A game design document is like a diary for game developers.
mafiozo [28]
The answer is true. A game design document is like a diary for game developers.
5 0
3 years ago
You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
n200080 [17]
The answer is b. java Hi.class :)
8 0
3 years ago
Manuel is working on a project in Visual Studio. He wants to keep this program showing on the entire desktop, but he also needs
patriot [66]

Answer:

d. Task View

Explanation:

Based on the scenario being described within the question it can be said that the best feature for this would be the Windows 10 task view. This is a task switcher and  virtual desktop system included in the Windows 10 operating system, and allow the individual user to quickly locate, manage, open or hide different windows/tasks. Such as having several projects open in different monitors running at the same time.

3 0
4 years ago
To use the Web, each client computer requires a data link layer software package called a Web browser. True False
Luden [163]

Answer:

The answer is "False"

Explanation:

The data link layer is the protocol layer within a program, which controls data movement into a physical wireless connection. This layer is a second layer, that is also known as a collection of communications applications.

  • The server network, in which many clients request, and receive service from a centralized server.
  • This system provides an interface, that enables a user to request server services and view the server returns results, that's why it is wrong.
6 0
3 years ago
What is the purpose of system software?
Lilit [14]

The purpose of system software on a computer system is: B. to provide basic operational functionality by coordinating hardware components.

<h3>What is a software?</h3>

A software can be defined as a set of executable instructions that is typically used to instruct a computer system on how to perform a specific task (function) and proffer solutions to a particular problem.

<h3>The types of software.</h3>

Generally, there are three main types of software and these include the following:

  1. Application software
  2. Utility software
  3. System software

In Computer technology, a system software is the most important pre-installed software because it allows an end user to use the computer the first time he or she turns it on, especially by coordinating hardware components. Also, some examples of a system software include the following:

  • Utilities.
  • Search engines
  • Stand-alone operating systems.
  • Real-time operating systems.

Read more on system software here: brainly.com/question/1416480

#SPJ1

6 0
1 year ago
Other questions:
  • List five types of system information that can be obtained from the windows task manager. how can you use this information to co
    5·1 answer
  • A car moves down the street at 45 kph. The driver takes his foot off the gas pedal but does not brake. Which is the correct expl
    5·2 answers
  • Part 2: students and courses, part 1  java review you may use an ide or a text editor, but i will test this by compiling and ru
    6·1 answer
  • Write a program that prints the following 45 pairs of numbers:
    10·1 answer
  • What word processing feature saves you the most time when keying a document a. Thesaurus
    9·1 answer
  • Does it matter if watch comes without box and papers
    10·1 answer
  • Joshua needs to join in two cells together which of the following would perform the function
    14·1 answer
  • Which statement about comments is false? Select one: a. Lengthy comments can cause poor execution-time performance. b. Comments
    7·1 answer
  • What are the most positive and the most negative decimal numbers that can be represented by a 2C (n+k) bit fixed-point number, w
    12·1 answer
  • (isc)² certified information systems security professional official study guide 6th editionauthors: stewart, james michael; chap
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!