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
madreJ [45]
3 years ago
5

You will write a flowchart, and C code for a program that does the following: Within main(), it asks for the user's annual incom

e.Within main(), it calls a function called printIt() and passes the income value to printIt(). The printIt() function evaluates the income, and if the number is over 90000, prints a congratulatory message. If the income is not over 90000, it prints a message of encouragement, like "You WILL make $90,000, if you keep going."

Computers and Technology
1 answer:
elena-s [515]3 years ago
7 0

Answer:

Explanation:

To write a C program for the above problem:

#include <stdio.h>

int main()

{

// we define the variable to get the annual income

float AnIncome;

// to get the annual income from the user

printf("Enter your annual income here: ");

scanf("%f", &Anincome);

// This is the function to test the annual income

float printIt(x){

//we test the amount inputted now

if (x>= 90000){

printf("Congratulations on your income\n"); // This is the congratulatory message

}

if (x<=0){

// This statement is included to avoid putting zero as annual income

printf("Annual Income cannot be zero or less than zero\n");

}

else{

printf("You WILL make $90,000, if you keep going.\n");

}

}

printIt(AnIncome);

return 0;

}

Attached is the image for a flow chat for the program

You might be interested in
A doge is a shiba inu or probably a meme
Doss [256]
Yes the doge is a shiba
7 0
3 years ago
Read 2 more answers
Save an image as a separate file by right-clicking the image and then clicking this option at the
Olenka [21]

Answer:

Save image as

Explanation:

6 0
2 years ago
Read 2 more answers
What is an example of a situation in which you might use the append method? In what ways is the append method limited?
Oksanka [162]
If I had an array of the names of people who just walked in the door. I’d append the name of the person who came in next. To update the array.

The append method needs to be looped through to add multiple inputs
5 0
2 years ago
Why we need to measure the amperage of an electric current?​
Romashka [77]

Answer:

Explanation:It is very important to have a way to measure and quantify the flow of electrical current. When current flow is controlled it can be used to do useful work. The flow of electrons is measured in units called amperes. The term amps is often used for short

5 0
3 years ago
Question 2 In this question you are asked to calculate probabilties for the discrete uniform and exponential distribution. Make
sasho [114]

Answer:

Hi there! The question is asking to make changes to the H3_Q2.java program however there is no such program attached. Nevertheless, the requirements in the question can be addressed in a new H3_Q2.java program that i've listed below.

Explanation:

We can use the Scanner util in Java for prompting user input. The method nextInt() and nextDouble() allow only values of types "int" and "double" respectively. I have used the "switch" statement to direct the program based on user selection of menu item. The checks are printed with the "System.out.println" command and the program exits in case of error or invalid input. Finally, the calculation of probability simply requires you to replace the comment with the formula for the probability calculation based on the method chosen.

H3_Q2.java

import java.util.Scanner;

public class H3_Q2 {

 public static void main(String args[]) {

   // print main menu for user selection

   System.out.println("Please type 1 to select 'discrete uniform' or 2 to select 'exponential'");

   Scanner scan = new Scanner(System.in);

   int selection = scan.nextInt();

   switch(selection) {

     case 1:

       // discrete uniform

       System.out.println("Please enter a lower bound value a: ");

       int a = scan.nextInt();

       System.out.println("Please enter a upper bound value b: ");

       int b = scan.nextInt();

       System.out.println("Please enter a value x: ");

       int x = scan.nextInt();

       if (b <= a) {

         System.out.println("The upper bound value b should be greater than the lower bound value a");

         System.exit(0);

       }

       if (a > x) {

         System.out.println("The value x should be greater than the lower bound value b");

         System.exit(0);

       }

       if (b < x) {

         System.out.println("The value x should be greater than the lower bound value b");

         System.exit(0);

       }

       break;

     case 2:

       // exponential

       System.out.println("Please enter a lambda value for exponential: ");

       double lambda = scan.nextDouble();

       System.out.println("Please enter a value x: ");

       double d_x = scan.nextDouble();

       if (d_x <= 0.0) {

         System.out.println("The value x should be greater than 0");

         break;

       } else {

         // calculate P(X = x) and P(X ≤ x)

         // result = calculateExponential()

         System.out.println("The calculation for the exponential method given the lambda value " + lambda + " and the value of x " + d_x + " is: ");

       }

       break;

     default:

       System.out.println("Invalid input. Exiting..");

       break;

   }

 }

}

7 0
3 years ago
Other questions:
  • What keyboard combination can you use to open the windows tool context menu, which contains options such as power options and di
    5·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • What setting in Blender allows you to see the Graph Editor?
    13·1 answer
  • This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given p
    14·1 answer
  • Write a script that will read from a file x and y data points in thefollowing format:
    9·1 answer
  • Which of the following are disadvantages of networks? Check all of the boxes that apply.
    14·1 answer
  • Referat noaptea la școala cu sfârșit de groază​
    10·1 answer
  • Name the application used for creating Presentations___
    5·2 answers
  • Create a list of 5 potential jobs that students of computer science can obtain.
    9·2 answers
  • Which type of evidence should victims collect to help officials catch cyber bullies?home addressesbirthdayssocial media username
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!