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
pashok25 [27]
3 years ago
15

A restaurant recorded the ages of customers on two separate days. You are going to write a program to compare the number of cust

omers in their forties (ages 40 to 49).
What is the missing line of code?

customerAges = [33, 23, 11, 44, 35, 25, 35, 68, 51]

count40s = 0
for item in customerAges:
_____;
count40s = count40s + 1
print("Forties:", count40s)


if 40 > item > 49

if 40 < item < 49

if 40 <= item <= 49:

if 40 >= item >= 49
Computers and Technology
1 answer:
Mama L [17]3 years ago
5 0

Answer:

if 40>= item >=49

Explanation:

You might be interested in
Write an application that inputs three numbers (integer) from a user. (10 pts) UPLOAD Numbers.java a. display user inputs b. det
SCORPION-xisa [38]

Answer:

The program to this question as follows:

Program:

import java.util.*; //import package for user input

public class Number //defining class Number

{

public static void main(String[] ak)throws Exception //defining main method

{

int a1,b1,c1; //defining integer variable

int p_Count=0,n_Count=0,n_Zero=0,even_Count=0,odd_Count=0;

Scanner obx=new Scanner(System.in); //creating Scanner class object

System.out.println("Input all three numbers: "); //print message

//input from user

a1=obx.nextInt(); //input value

b1=obx.nextInt(); //input value

c1=obx.nextInt(); //input value

//check condition for a1 variable value

if(a1>0) //positive number

p_Count++;

else if(a1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(a1%2==0)//check even number

even_Count++;

else //for odd number

odd_Count++;

//check condition for b1 variable value

if(b1>0) //positive number

p_Count++;

else if(b1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(b1%2==0) //check even number

even_Count++;

else //for odd number

odd_Count++;

//check condition for c1 variable value

if(c1>0) //positive number

p_Count++;

else if(c1==0) //value equal to 0

n_Zero++;

else //value not equal to 0

n_Count++;

if(c1%2==0) //check even number

even_Count++;

else //for odd number

odd_Count++;

//print values.

System.out.println("positive number: "+p_Count);//message

System.out.println("negative number: "+n_Count); //message

System.out.println("zero number: "+n_Zero); //message

System.out.println("even number: "+even_Count); //message

System.out.println("odd number: "+odd_Count); //message

}

}

Output:

Input all three numbers:

11

22

33

positive number: 3

negative number: 0

zero number: 0

even number: 1

odd number: 2

Explanation:

In the above java program code a class is defined in this class three integer variable "a1,b1, and c1" is defined which is used to take input value from the user end, and other integer variable "p_Count=0, n_Count=0, n_Zero=0, even_Count=0, and odd_Count=0" is defined that calculates 'positive, negative, zero, even, and odd' number.

  • In the next step, the conditional statement is used, in if block a1 variable, b1 variable, c1 variable calculates it checks value is greater then 0, it will increment the value of positive number value by 1.
  • else if it will value is equal to 0. if this condition is true it will negative number value by 1
  • else it will increment zero number values by 1.
  • In this code, another if block is used, that checks even number condition if the value matches it will increment the value of even number by 1, and at the last print, method is used that print all variable values.
7 0
3 years ago
A director was fined heavily for shooting in his own house in New York. What do you think was his mistake?
Mnenie [13.5K]

Answer: B. He forgot to get the filming permit.

8 0
3 years ago
Read 2 more answers
19. Squares. Write a program class named SquareDisplay that asks the user for a positive integer no greater than 15. The program
BaLLatris [955]

Answer:

Explanation:

import java.util.Scanner;

public class SquareDisplay {

   public static void main(String []args){

    // Scanner is used to get value from command line

       Scanner console = new Scanner(System.in);

       System.out.print("Enter an integer in the range of 1-15:");

       int number = console.nextInt();

   // check if number is greater then 15 or less then 1 then return error message

       if(number>0 && number<=15){

           System.out.println("Error :Wrong Input");

           return;

       }

       for( int i=0; i< number; i++){

           for( int j =0; j<number; j++){

               System.out.print("X");

           }

           System.out.print(" ");

       }

   }

}

Code Explanation

As we want to show the square of X's we need to execute 2 nested for loop to achieve the target result. Outer for loop will determine that how many times we need to show the group of X's.

And the inner for loop will actually display's number of X's for every outer loop iteration.

Output

Case 1:

Enter an integer in the range of 1-15:5

XXXXX XXXXX XXXXX XXXXX XXXXX

Case 2:

Enter an integer in the range of 1-15:16

Error :Wrong Input

Case 3:

Enter an integer in the range of 1-15:2

XX XX

4 0
3 years ago
Effective resource management: a. Locks out unauthorized access and can work to prevent changes to resources by internal users n
alexgriva [62]

Answer:

c. Enables a security administrator to control user and resource access from individual machines rather than from a central location.

Explanation:

Effective resource management requires that network resources or databases be accessed securely or protected from unauthorized users. A company with an effective resource management policy like Amazon cloud services and Google cloud services allows for an administrator to Grant access to a group of users with configured individual devices.

6 0
4 years ago
How to create json object from variables javascript
tino4ka555 [31]
Not entirely sure what you want to achieve, but consider this program:

var a = 'foo';
var b = 'bar';

var c = { first : a, second : b };

console.log(JSON.stringify(c, null, 4));

A json object c is constructed using the values from variables a and b. Is this what you mean?
8 0
4 years ago
Other questions:
  • If you like to interact with the game’s environment rather than with its inhabitants, which Bartle player type would you conform
    12·2 answers
  • To remove any hidden days from your document before sharing it, what should you do?
    7·1 answer
  • In a _____, if any link between nodes is severed, the entire network is affected, and failure of a single node disrupts the enti
    9·1 answer
  • 2 A_______<br> uses graphics or pictures to help the user navigate and<br> access programs
    14·1 answer
  • Moore’s law states that the number of transistors on integrated circuits doubles approximately every two years?
    15·2 answers
  • What is the full form of RAM. ​
    5·2 answers
  • The software maintains and manages information related to employees, rooms, committees, and committee meetings of a company. The
    9·1 answer
  • Why media is far from government​
    6·2 answers
  • You have searched a database to locate US cities with population counts above 1 million people. You need to present the results
    6·2 answers
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!