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
Whitepunk [10]
4 years ago
15

1)Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "positive" otherwise. Examp

le output when userVal = -9 for the below sample program:
-9 is negative.
#include
#include

int main(void) {
char condStr[50] = "";
int userVal = 0;

userVal = -9;

strcpy(condStr, /* Your solution goes here */);

printf("%d is %s.
", userVal, condStr);

return 0;
}

2)

Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7. Hint: Start with "numUsers = ...".

#include

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

numUsers = 8;
updateDirection = 1;

/* Your solution goes here */

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

return 0;
Computers and Technology
2 answers:
SSSSS [86.1K]4 years ago
7 0
1. userVal < 0 ? "negative" : "positive"

2. updateDirection == 1 ? numUsers++ : numUsers--;
Licemer1 [7]4 years ago
5 0

Answer:

1:

if userVal<0

cout <<" negative":

userVale >0

cout<<"positive":

2:

if

updateDirection ==1;

numUsers++;

cout<<"numUser"

else

numUser--;

cout<<"numUser";

You might be interested in
Tom's using Google Ads to promote his bicycle store. He's created an Android App and needs to measure how effectively the curren
m_a_m_a [10]

Answer:

Option B is correct.

Explanation:

The mobile app conversion tracking will help Tom to see how many people who see the ads, actually install the app and use it. It will also track how many people use the app to make purchases or perform any other action.

It's a useful way to keep track on the success of the ad campaign.

7 0
4 years ago
Which of the following is a form of mediated communication?
damaskus [11]
<span>typically mediated communication is the use of any technical medium for transmission across time and space, or that is how Thus Davis defines it. i would say b, but it depends what sort of mediated communication you are referring to. but facebook is computer-mediated communication.</span>
3 0
4 years ago
How do you add a section break that would start the new section on the same page?
Maksim231197 [3]
Leave a line and that will make a section break
8 0
4 years ago
Read 2 more answers
What are three subject areas that are key to successfully working in the field of robotics
Novosadov [1.4K]

The brain ( computer science engineering)

The nervous system ( electrical engineering)

The body ( Mechanical engineering). The mechanical engineer is in the charge of the physical system that makes up the robot.

4 0
3 years ago
Create an application named TestClassifiedAd that instantiates and displays at least two ClassifiedAd objects. A ClassifiedAd ha
arlik [135]

Answer:

Following is given the code with all necessary descriptions as comments in it. The output is also attached under the code. I hope it will help you!

Explanation:

5 0
3 years ago
Other questions:
  • Bill needs to make a presentation in which he has to represent data in the form of a pyramid. Which feature or menu option of a
    14·1 answer
  • Theâ ______ is a large worldwide collection of networks that use a common protocol to communicate with one another.
    5·1 answer
  • Although the American National Standards Institute publishes the specifications for a standard SQL language, each DBMS vendor ha
    7·1 answer
  • Which of the following is the most common tool that Windows administrators use on the domain controller?
    9·1 answer
  • What is added to the &lt; meta &gt;tag to describe the encoding type?
    15·1 answer
  • Help!!! Who is this? Who is it from?
    14·2 answers
  • Write a python program stored in file extra_credit.py that takes three different inputs from the user where : First Input: The p
    7·1 answer
  • which is a set of techniques that use descriptive data and forecasts to identify the decisions most likely to result in the best
    8·1 answer
  • I am wasting 20 points
    10·2 answers
  • HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!