answer.
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
rosijanka [135]
2 years ago
12

Write a statement that uses a conditional expression that determines if the credits variable is less than 0. If the condition is

true, assign the value 0 to the credits variable, otherwise the value of the credits variable should remain unchanged.
Computers and Technology
1 answer:
gtnhenbr [62]2 years ago
8 0

Answer:

The statement and the expression is "credits = credits<0?0 : credits;" for the above question.

Explanation:

  • The conditional expression is an expression that is used to determine the true and the false case. It works like the if and the else statement.
  • It has three parts which are shown above, in which the first part is to check the condition, the second part is excuted if the condition is true and the third part is executed if the condition is false. The variable is used to assign the value.
  • If any user provides the credit value and writes the above statement then the credit variable holds 0 for negative value and it holds the original value for any positive or zero value.
You might be interested in
Which task can a company perform with intranets?
gregori [183]
I would probably say C, Though you might want a second, person to clarify. But My answer is C..
6 0
2 years ago
Read 2 more answers
Multiple boolean expressions can be combined by using a logical operator to create ________ expressions.
Licemer1 [7]
<span>Boolean expressions can be combined by using a logical operator to create compound expressions. A boolean expression is an expression that takes into account and evaluates specific data, which is in the form of true and/or false. A compound expression is merely a statement of expressions.</span>
8 0
1 year ago
A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi
victus00 [196]

Answer:

I am writing a Python program.

def concordance(filename):  # function that takes a file name as parameter and returns the concordance for that file

   file = open(filename,"r")  #opens file in read mode

   unique={}  #creates and empty list

   for word in file.read().split():  #loops through every word in the file

       if word in unique:  # if words is already present in the list

           unique[word] += 1  #add 1 to the count of the existing word

       else:    #if word is not present in the list

           unique[word] = 1 #add the word to the list and add 1 to the count of word

           file.close();  # close the file

   for x in sorted(unique):  #sort the list and displays words with frequencies

       print(x, unique[x]);  #prints the unique words and their frequencies in alphabetical order

#prompts user to enter the name of the file

file_name=input('Enter the input file name: ')

concordance(file_name)  #calls concordance method by passing file name to it

Explanation:

The program has a function concordance that takes a text file name as parameter and returns a list of unique words and their frequencies.

The program first uses open() method to open the file in read mode. Here "r" represents the mode. Then creates an empty list named unique. Then the for loop iterates through each word in the file. Here the method read() is used to read the contents of file and split() is used to return these contents as a list of strings. The if condition inside the loop body checks each word if it is already present in the list unique. If the word is present then it adds 1 to the count of that word and if the word is not already present then it adds that unique word to the list and assign 1 as a count to that word. close() method then closes the file. The second for loop for x in sorted(unique):  is used to display the list of unique words with their frequencies. sorted() method is used to sort the list and then the loop iterates through each word in the list, through x, which acts like an index variable, and the loop displays each word along with its frequency.

6 0
1 year ago
E-mail is an efficient means of disseminating information quickly and inexpensively. However, HIPAA regulations affect e-mail us
oksano4ka [1.4K]

Sending potentially sensitive information by email

Potentially sensitive information can be sent via Email only if the Email is encrypted

Explanation:

No doubt Email is an inexpensive efficient means of communicating quickly. But it is prone to hacking and it is not a secure mechanism. In order to add security ,the Email needs to be sent in an encrypted form. Banking and HIPAA regulations require the emails to be sent in encrypted form as it is a secure mechanism. Even if one has the consent from the client , the Email has to be in encrypted. Even if the Organization's e-mail system has appropriate firewalls and related infrastructure , the golden rule is to send encrypted format Emails.

7 0
2 years ago
At one college, the tuition for a full-time student is $8,000 per semester. It has been announced that the tuition will increase
inn [45]

Answer:

#include <iostream>

using namespace std;

 

int main () {

  // for loop execution

  int semester_fees=8000;

  int b=1;

  cout<<"there are 5 years or 10 semester fees breakdown is given below"<<endl;

  for( int a = 1; a <=5; a++ ) {

     semester_fees = semester_fees*1.03;

     cout<<"Semester fees for each of semester"<<b++<<"and"<<b++<<"is:$"<<semester_fees<<endl;

     

  }

 

  return 0;

}

Explanation:

code is in c++ language

Fees is incremented yearly and i have considered only two semester per year

3 0
1 year ago
Other questions:
  • 8. In time series, which of the following cannot be predicted? A) large increases in demand B) technological trends C) seasonal
    11·1 answer
  • When ____ occur during preliminary debugging, dummy print statements—statements that are temporarily inserted into the code to d
    9·1 answer
  • A(n) ____ attack is when a system is compromised and used to attack other systems. a. indirect b. direct c. object d. subject
    13·1 answer
  • Identify two entities and 2 of their attributes from the given scenario.
    9·1 answer
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    13·1 answer
  • Pick a 3D game you enjoy or know about. Pick a scene from that game that has at least one character in it and describe the scene
    9·1 answer
  • Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
    14·1 answer
  • What do you call the two parts of lift that go down a mine
    13·2 answers
  • Exercise 3.6.9: 24 vs. "24"5 points
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!