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
Alisiya [41]
3 years ago
10

Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:

If userVal is -9, output is:
-9 is negative. PLEASE USE C++
Computers and Technology
1 answer:
Goryan [66]3 years ago
5 0

Answer:

PROGRAMMING APPROACH:

  • Define the necessary header file using namespace.
  • Define the main() method.
  • Declare variable inside the function().
  • Print result.

Explanation:

Required C++ Code:

#include<iostream>

#include<string>

using namespace std;

int main()

{

  string condStr;

  int userVal;

  cin>>userVal;

  condStr=(userVal<0)?("negative"):("non-negative");

  cout<<userVal<< " is "<< condStr <<"."<<endl;

}

OUTPUT:

-2

-2 is negative.

You might be interested in
Pls answer i need to turn it in today!!
Marianna [84]

Answer:

See Explanation

Explanation:

How decisions are represented?

In flowcharts, decisions are represented using diamond shapes (see attachment)

Decisions could be conditional statement or repetition operations which may have the form of loops or iterations.

Either of theses are represented using the diamond shapes.

Take for instance:

To check if a is greater than b... Simply write if a > b i the diamond box

Command used for most decisions

Most decisions are conditional statements; hence, the if command is often used for decisions.

5 0
3 years ago
which of the following sentences uses active voice?(answers to choose from are in the photo)-this is in my computer applications
andrezito [222]
Last week, Nate and I counted all the inventory. answer :A
6 0
3 years ago
Read 2 more answers
Why does brainly have 3-2 sites? I'm asking since I get tired from making 3-2 accounts on each one. Well by checking each accoun
Lyrx [107]
Each site could be for a different region for Brainly mainly because I just checked and one of the other Brainly sites had a lot more different people having questions in different languages.  
6 0
3 years ago
For a college to take a high school class as an equivalent, what must be in place?a transfer agreementan articulation agreementa
hjlf
An articulation agreement is generally required for a college student to take a high school class as equivalent. In addition, it is a formal argument wherein the two universities are in a partnership that decides the course of action to be done with regards to the transfer policies of the students. 
3 0
3 years ago
Make The PYTHON Code<br><br> print first 3 character of a string - given "Seattle" expected "Sea"
vlada-n [284]

This program uses a conditional to determine if seafood is safe to consume.

IF (seafood = "mollusk" OR daysFrozen ≥ 7) { rating ← "safe" } ELSE { rating ← "unsafe" }

In which situations will rating be "safe"?

️Note that there may be multiple answers to this question.

Choose all answers that apply:Choose all answers that apply:

1. When sea food is mollusk and day frozen is 1

2.When sea food is mollusk and day froze is 9

3. When see food salmon and day frozen is 7

<em>Did that help?</em>

6 0
2 years ago
Other questions:
  • Please help!
    10·1 answer
  • What makes Group Policy such a powerful tool is its ability to enable security administrators to:_________.
    8·1 answer
  • The program has a compilation error because s is not initialized, but it is referenced in the println statement. The program has
    8·1 answer
  • Framing can create which of the following in a photograph? Mystery Saturation Aperture All of the above
    10·2 answers
  • Organizational sites with .org domains are usually managed by what type of organization
    7·1 answer
  • Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output the month,
    10·1 answer
  • How do you access the Control Panel?
    7·1 answer
  • The marketplace for computer hardware:________ 1. has become increasingly concentrated in top firms 2. has expanded to include a
    5·2 answers
  • When working in Photoshop with the move tool, you can select multiple layers and use this option to arrange them into a straight
    7·2 answers
  • Chloe is creating the software requirements specifications (SRS) for a project. The project is a web app that allows students to
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!