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
GuDViN [60]
3 years ago
8

Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. A boolean variable named recalled has be

en declared. Given a variable modelYear write a statement that assigns true to norecall if the value of modelYear does NOT fall within the two recall ranges and assigns false otherwise. Do not use an if statement in this exercise!
Computers and Technology
1 answer:
AlekseyPX3 years ago
3 0

Answer:

boolean recalled;

((modelYear>=1995 && modelYear <=1998) || (modelYear>=2004 && modelYear<=2006)) ? recalled =true : recalled =false;

Explanation:

In the first line of the code we declare the variable of type boolean (values can only be true or false) then using the conditional expression operator (ternary operator) in place of an if statement, We state the conditions of the years that will return true and vice versa

You might be interested in
For every $1 of deposits, the banks can increase ________________ by the value of the Money Multiplier.
Snowcat [4.5K]
<span>A. Aggregate Price Level</span>
8 0
3 years ago
The Account class contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and a
melamori03 [73]

Answer:

I've updated the Account class as per the instructions. The instructions mention "the constructor for this class creates a random account number" although I didn't find where that was. As a result, I created a simple method to generates the account number (located at the bottom of the class). Be sure you understand the changes (highlighted in yellow) and feel free to ask follow-up questions:

Explanation:

//*******************************************************

// Account.java

//

// A bank account class with methods to deposit to, withdraw from,

// change the name on, and get a String representation

// of the account.

//*******************************************************

import java.util.Random;   // Used for Random # generator

public class Account

{

      private double balance;

  private String name;

     private long acctNum;

      //----------------------------------------------

 //Constructor -- initializes balance, owner, and account number

  //----------------------------------------------

 public Account(double initBal, String owner, long number)

{

        balance = initBal;

               name = owner;

            acctNum = number;

}

// !!!!!! New Constructor !!!!!!

public Account(double initBal, String owner)

     {

        balance = initBal;

               name = owner;

            acctNum = generateAccountNumber();

       }

  // !!!!!! New Constructor !!!!!!

 public Account(String owner)

     {

        balance = 0;

             name = owner;

            acctNum = generateAccountNumber();

       }

   //----------------------------------------------

 // Checks to see if balance is sufficient for withdrawal.

// If so, decrements balance by amount; if not, prints message.

  //----------------------------------------------

 public void withdraw(double amount)

      {

        if (balance >= amount)

                balance -= amount;

               else

                     System.out.println("Insufficient funds");

}

 // !!!!!! New withdraw() method !!!!!!

   public void withdraw(double amount, double fee)

  {

        double amountWithFee = amount + fee;

               if (balance >= amountWithFee)

                 balance -= amountWithFee;

        else

                     System.out.println("Insufficient funds");

}

   //----------------------------------------------

 // Adds deposit amount to balance.

       //----------------------------------------------

 public void deposit(double amount)

       {

        balance += amount;

       }

  //----------------------------------------------

 // Returns balance.

      //----------------------------------------------

 public double getBalance()

       {

        return balance;

  }

    //----------------------------------------------

 // Returns a string containing the name, account number, and balance.

    //----------------------------------------------

 public String toString()

 {

        return "Name:" + name +

          "\nAccount Number: " + acctNum +

         "\nBalance: " + balance;

 }

 // !!!! NEW PRIVATE HELPER METHOD TO GENERATE ACCOUNT NUMBERS !!!!!

//-------------------------------------------------------

// Returns a random account number between 10000 - 99999

 //--------------------------------------------------------

       private long generateAccountNumber()

     {

        Random r = new Random();        // Seed the random number genertor with the system time

         return 10000 + r.nextInt(89999);        // .nextInt(89999) will return a value between 0 and 89999)

      }

}

8 0
4 years ago
explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
BigorU [14]

It means that there are people  who understand binary and those that do not understand it. That is, binary is said to be the way that computers are known to express numbers.

<h3>What is the joke about?</h3>

This is known to be a popular  joke that is often  used by people who are known to be great savvy in the field of mathematics.

The joke is known to be one that makes the point that a person is implying that the phrase is about those who only understands the decimal system, and thus relies on numbers in groups of 10.

The binary system is one that relies on numbers that are known to be  in groups of 2.

Therefore, If the speaker of the above phrase is one who is able to understand binary, that person  would  be able to say that that the phrase  is correctly written as  "there are 2 types of people that understand binary".

Learn more about binary from

brainly.com/question/21475482

#SPJ1

8 0
2 years ago
Define the term editing​
Harrizon [31]

Answer:

editing is a word file mean making changes in the text contain is a file. or a word file is one of the most basic ms office word operation.

8 0
3 years ago
What size hard disc is recommended for powerpoint writting
mixas84 [53]

Answer:

Depends on how many PowerPoint files you want to store and how long they are. I'd recommend at least a 256GB hard drive to store your OS and software and then leave space for PowerPoints.

5 0
3 years ago
Other questions:
  • (Microsoft excel) The data selected to create a table must include
    6·2 answers
  • Create a cell reference in a formula by typing in the cell name or
    7·2 answers
  • What do you click to move to the next cell in the row?
    7·1 answer
  • Which is a group of related software applications that are bundled and sold together?
    9·2 answers
  • Which firewall has a network interface located in a unique network segment that allows for true isolation of the segments and fo
    9·1 answer
  • allows Internet telephony service providers to deliver telephony services and unified communications applications offering voice
    14·1 answer
  • Plz answer me will mark as brainliest ​
    8·1 answer
  • Filtering data in Excel Online keeps all data on the screen and highlights the content that fits your criteria.
    9·1 answer
  • Which statement about digital certificates is​ FALSE? A. The CA verifies a digital certificate​ user's identity online. B. Digit
    7·1 answer
  • What should be entered to make the loop print
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!