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
Westkost [7]
3 years ago
12

Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. 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, it prints a congratulatory message. If the income is not over 90000, it prints a message of encouragement, like "You WILL make $50,000, if you keep going."

Computers and Technology
1 answer:
Fiesta28 [93]3 years ago
7 0

Answer:

I am writing a C program:

#include <stdio.h> //to use input output functions

void printIt(double annual_in){ //function printIt

   if(annual_in >90000) //check if the income is greater than 90000

   printf("Congratulations. Doing great!"); //print this message if income value is greater than 90000

   else //if annual income is less than 90000

   printf("You WILL make $50,000, if you keep going"); } //print this message if income value is less than 90000

int main() //start of main() funciton body  

{   double income; //declares a double type variable income to hold annual income value

   printf("Enter annual income: "); //prompts user to enter annual income

   scanf("%lf",&income); //reads income value from user

   printIt(income); } // calls printIt method by passing input income to that function

     

Explanation:

The program is well explained in the comments mentioned with each statement of the program. The flowchart is attached.

First flowchart flow1 has a separate main program flowchart which reads the income and calls printIt function. A second flowchart is of prinIt() method that checks the input income passed by main function and displays the corresponding messages and return.

The second flowchart flow2 is the simple flowchart that simply gives functional description of the C program as flowchart is not where giving function definitions is important. Instead of defining the function printIt separately for this C program, a high-level representation of functional aspects of this program is described in second flowchart while not getting into implementation details.

You might be interested in
Use the web to learn how to use the LocalDate Boolean methods isBefore(), isAfter(), and equals(). Use your knowledge to write a
Brrunno [24]

Answer:

Explanation:

The code provided is already taking in the input and comparing it to the current date using the methods isBefore(), isAfter(), and equals(). It works perfectly and did not need any changes to the code. As you can see from the attached pictures below, every scenario works as intended. If the format is not correct and the date object is not able to be created then it prompts an error message and exits the program as intended.

import java.util.*;

import java.time.LocalDate;

class PastPresentFuture2

{

   public static void main(String args[])

   {

       int mo,da,yr;

       LocalDate today=LocalDate.now();

       System.out.println("Program to find if the given date is in past, present or future::");

       Scanner input=new Scanner(System.in);

//taking inputs from console and storing them in three variables.

       System.out.print("Enter month::");

       mo=input.nextInt();

       System.out.print("Enter day::");

       da=input.nextInt();

       System.out.print("Enter year::");

       yr=input.nextInt();

//creating a LocalDate object and initializing it to null;

       LocalDate inputDate=null;

       try

       {

           /*we are using the 3 variables and converting it into a date object to compare it with today's date */

           inputDate = LocalDate.of(yr,mo,da);

       }

       catch(Exception ex)

       {

           /*if the entered day,month & year are not converted to a date object because of invalid entry of any values, we are stopping the program.*/

           System.out.println("You have made invalid entries, please try again !!");

           System.exit(0);

       }

       /*if the date object is created after proper entries, we are using the built-in functions to compare it the today's date object*/

       System.out.print("The date you entered is ");

       if(inputDate.isBefore(today))

           System.out.println("in the past.");

       else

       if(inputDate.isAfter(today))

           System.out.println("in the future.");

       else

       if(inputDate.equals(today))

           System.out.println("the current date.");

   }

}

3 0
3 years ago
URGENT HELPP<br> WILL MARK BRAINLIST
Semenov [28]

Answer:

1. (1) Travel guide, (2) Study notes for students , (3) Some creative ideas that I want to share with others

2. (1) he or she would have some work related to the website I have created, (2) he or she would be interested in knowing about something which would be available in my created website

3. I want to learn how to add photos in the html pages

3 0
3 years ago
Look at the following function header: def my_function(a, b, c): Now look at the following call to my_function: my_function(3, 2
Citrus2011 [14]

Answer:

3 will be assigned to a

Explanation:

Given

Function definition: def my_function(a, b, c)

Required

What is the value of a if the function is called as my_function(3, 2, 1)

First, we need to check if the function is rightly called.

myfunction is defined with three parameters a, b and c

myfunction is called with three arguments 3, 2 and 1

When called, the arguments will be assigned to each parameter in the order which they were declared.

This implies that:

a = 3

b = 2

c = 1

4 0
3 years ago
I have no idea which one please help!
shutvik [7]

Answer:

i think its the second one

Explanation:

brainliest pls

6 0
3 years ago
Read 2 more answers
KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales f
AVprozaik [17]

Answer:

In C++:

#include<iostream>  

using namespace std;  

int main() {  

  int depts[3][4];

  char dptcod [3] ={'X','Y','Z'};

  for (int rrw = 0; rrw < 3; rrw++) {  

      for (int cll = 0; cll < 4; cll++) {  

          cout<<"Dept "<<dptcod[rrw]<<" Q"<<(cll+1)<<": ";

          cin>>depts[rrw][cll];  }  }  

      for (int rrw = 0; rrw < 3; rrw++) {  

          int total = 0;

          for (int cll = 0; cll < 4; cll++) {  

              total+=depts[rrw][cll]; }

              cout<<"Dept "<<dptcod[rrw]<<" Total Sales: "<<total<<endl;}  

  return 0; }

Explanation:

This declares the 3 by 4 array which represents the sales of the 3 departments

  int depts[3][4];

This declares a character array which represents the character code of each array

  char dptcod [3] ={'X','Y','Z'};

This iterates through the row of the 2d array

  for (int rrw = 0; rrw < 3; rrw++) {  

This iterates through the column

      for (int cll = 0; cll < 4; cll++) {

This prompts the user for input

          cout<<"Dept "<<dptcod[rrw]<<" Q"<<(cll+1)<<": ";

This gets the input

          cin>>depts[rrw][cll];  }  }  

This iterates through the row of the array

      for (int rrw = 0; rrw < 3; rrw++) {

This initializes total sum to 0

          int total = 0;

This iterates through the column

          for (int cll = 0; cll < 4; cll++) {

This calculates the total sales of each department

              total+=depts[rrw][cll]; }

This prints the total sales of each department

              cout<<"Dept "<<dptcod[rrw]<<" Total Sales: "<<total<<endl;}  

I hope this helps a little bit

6 0
3 years ago
Other questions:
  • A personal naratiation is like a autobiography in that it
    8·1 answer
  • The Campus Housing Service helps students find apartments. Owners of apartments fill in information forms about the rental units
    14·1 answer
  • System uses a 6-bit 2’s complement signed integer representation. What is the range of decimal values it can represent?
    14·1 answer
  • Website reputation is an important part of page quality (PQ) rating. Reputation can justify the Highest rating and the Lowest ra
    15·1 answer
  • PLATO
    6·2 answers
  • Refer to the exhibit, a technician applies the configuration in the exhibit to an unconfigured router. To verify the configurati
    13·1 answer
  • How do you italicise, bold, letters on this app?​
    11·2 answers
  • Denise found a volume of documents in the trash bin that contained individuals, names, social security numbers and years of birt
    14·1 answer
  • You have posted some embarrassing photos of a friend onto the Internet. After
    6·1 answer
  • true or false? the email body copy, the body design/layout, the body images, the cta, and the email signature are all elements t
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!