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
oksano4ka [1.4K]
2 years ago
10

Given two variables, is Empty of type boolean, indicating whether a class roster is empty or not, and number Of Credits of type

int, containing the number of credits for a class, write an expression that evaluates to true if the class roster is empty or the class is exactly three credits.
Computers and Technology
1 answer:
Alex_Xolod [135]2 years ago
4 0

Answer:

     if(isEmpty || numOfCredits==3){

         

     }

Explanation:

Consider a complete java program below that prompts user for  number of credits and also asks if class roster is empty or not

<em>import java.util.Scanner;</em>

<em>public class num13 {</em>

<em>    public static void main(String[] args) {</em>

<em>        boolean isEmpty = false;</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Is class Rooster Empty? Yes or No");</em>

<em>        String ans = in.next();</em>

<em>        if(ans.equalsIgnoreCase("yes")){</em>

<em>            isEmpty = true;</em>

<em>        }</em>

<em>        else isEmpty =false;</em>

<em>        System.out.println("Enter number of credits");</em>

<em>      int numOfCredits = in.nextInt();</em>

<em>      if(isEmpty||numOfCredits==3){</em>

<em>          System.out.println("True");</em>

<em>      }</em>

<em>      else {</em>

<em>          System.out.println("Not true");</em>

<em>      }</em>

<em>    }</em>

<em>}</em>

You might be interested in
True or False: Nested elements must be indented with respect to parent elements in
Dovator [93]

Answer:

true

Explanation:

7 0
2 years ago
Identify the menu under which you'll find the Header and Footer option.
Genrish500 [490]

The answer is B. View.

4 0
3 years ago
Choose the answer.
expeople1 [14]

There are no options can u give options.

4 0
3 years ago
write a function that counts the number of times the value of y occurs in the first n values in array x. y is an integer variabl
mixer [17]

Answer:

Following are the function of count:

void count(int y,int x[],int n) // function definition of count

{

int k,count=0;  // variable declaration

for(k=0;k<n;++k) // iterating over the loop

   {

   if(x[k]==y) //check the conndition number of times the value of y occurs

   {

   count++; // increment of count by 1

   }

   }

Explanation:

Following are the code in c language

#include <stdio.h> // header file  

void count(int y,int x[],int n) // function definition of count

{

int k,count=0;  // variable declaration

for(k=0;k<n;++k) // iterating over the loop

   {

   if(x[k]==y) //check the conndition number of times the value of y occurs

   {

   count++; // increment of count by 1

   }

   }

   printf(" the number of times the value of y occurs :%d",count); // display count value

   }

int main() // main method

{

   int x[100],y,n,k; // variable declarartion

   printf(" Enter the number of terms n :");

   scanf("%d",&n); // input the terms

   printf(" Enter the array x :");

   for(k=0;k<n;++k) // input array x

   {

   scanf("%d",&x[k]);

   }

   printf("Enter the value of y:");

   scanf("%d",&y);// input value y by user

    count(y,x,n); // calling function

   return 0;

}

In the given program we declared an array x ,variable  y and n respectively Input the array x ,y,n  by user after that we call the function count .In the count function we iterate the loop from o position to array length-1 and check the number of times the value of y occurs by using if statement  i.e  if(x[k]==y) if the condition of if block is true then we increment the count variable Otherwise not .Finally display the count variable which describe the number of count.

Output

Enter the number of terms n :5

1

2

2

56

5

Enter the value of y:2

the number of times the value of y occurs :2

Enter the number of terms n :5

1

2

3

56

5

Enter the value of y:26

the number of times the value of y occurs :0

7 0
2 years ago
If you play video games, please answer these questions it’s for a survey for my game development class!!
yarga [219]

Answer:

Doom, fortnlte, mlnecraft, ark survival evolved, ark survival of the fittest, terraria, raft, among us, ect.

First person shooters, Third person shooters, Creative games

8-10 years

More VR, better graphics, more realistic

Maybe, not anytime soon.

Explanation:

5 0
2 years ago
Other questions:
  • You can select slide objects in order to delete them simultaneously by pressing the _____ key as you click each object. select o
    7·2 answers
  • This is not a factor that you should use to determine the content of your presentation. Your audience your goals your purpose yo
    7·2 answers
  • Kuta software infinite pre- algebra multiplying polynomial and a monomial find product answer key
    14·1 answer
  • What provides quality education for students
    14·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Hi need help on this <br> what is cyberspace
    14·1 answer
  • The goals of _____ are to determine the work load at which systems performance begins to degrade and to identify and eliminate a
    11·1 answer
  • Set of general format used to write program in any programming language?​
    10·1 answer
  • Which of the following IS an operating system? *<br> Reddit<br> Ubuntu<br> Office 365<br> Mac Pro
    9·1 answer
  • What is the two’s compliment of -95,-122,-111,-57
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!