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
KiRa [710]
4 years ago
13

Write a conditional expression that assign the value 0 to a credits variable if it is less than 0; otherwise the value of the cr

edits variable remains unchanged.
Computers and Technology
2 answers:
Svetach [21]4 years ago
6 0

Answer:

credits = (credits < 0) ? 0 : credits;

Explanation:

This is the ternary conditional operator.

grin007 [14]4 years ago
3 0

Answer:

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

Explanation:

I am going to write a C function for this.

The input is your credit value, and it has just a conditional to verify if it is not negative.

void updateCredit(float credit){

if credit < 0.0

credit = 0.0;

}

You might be interested in
What will the "background-color" of the "topButton" be when the program is finished running?
Lelu [443]

Answer:

Blue

Explanation:

set_Property - (topButton), (#background-color), (orange)

set_Property - (bottomButton), (#background-color), (red)

set_Property - (topButton), (#background-color), (blue)

set_Property - (bottomButton), (#background-color), (green)

Here, the background color for the 'topButton' would be "blue"  when the program is finished running, as it is the last task, the topButton would be set to or it is the last thing that will run for the button.

6 0
3 years ago
C++
vichka [17]

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

4 0
3 years ago
Repetition learning rates are the same for everyone, so there is no need to find an activation and break pattern that works
Leviafan [203]

Answer:

true

Explanation:

4 0
3 years ago
Read 2 more answers
Design a software system for a bookstore that keeps an inventory of two types of books: Traditional books and books on CD. Books
Sophie [7]

Answer:

Explanation:

a. In this scenario, the best solution would have an Object of Traditional Books, CD, Music, Bookstore and Customer.

b. All five objects would be able to be called by the main program loop and the Customer Object would call upon and use either the Books or CD object, While the Bookstore object would call upon all of the other objects.

c. Both the Bookstore object and Customer object will "have" other objects as the Bookstore needs to hold information on every Book or CD in the Inventory. While the Customer object would call upon the Book and CD object that they are purchasing.

d. The Music Object will extend the CD object and use information on the CD object as its parent class.

e. Since the Music Object extends the CD object it is also considered a CD since it is in CD format like the Books on CD and therefore is both objects.

8 0
3 years ago
The space that helps you organize your PowerPoint or Web Page is called ______.
sergeinik [125]

Answer:

the internet

Explanation:

cause I said

8 0
3 years ago
Other questions:
  • Does anyone watch The Office?
    14·1 answer
  • _____ are considered to be the most important element in a computer-based information system.
    8·1 answer
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • What is the difference between edge and core networks?
    13·1 answer
  • Python: Bad input on line 8. What is the fix, please can someone tell me I’m desperate?
    10·1 answer
  • Python - Write a program to print the multiplication table as shown in the image by using for loops.
    12·1 answer
  • A user calls to complain that her computer is behaving erratically. Some days it functions correctly, and other days, it crashes
    15·1 answer
  • A construction-based client would like to develop an application that can analyze an image of machinery and overlay information
    8·1 answer
  • An end-user license agreement protects _____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!