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

Budget Analysis (use while loop) Write a program that asks the user to enter the amount that he or she has budgeted for a month.

A loop should then prompt the user to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget.
Computers and Technology
1 answer:
Agata [3.3K]3 years ago
6 0

Answer:

print('This program will help you determine whether you\'ve budgeted enough ' +

     'for your expenses. You\'ll just need to enter your budget and the ' +

     'cost of each of your expenses for the month and we will calculate ' +

     'the balance.')

budget = float(input('How much have you budgeted this month? '))

expenses = 0

check = 0

while check >= 0:

   check = float(input('Enter an expense amount or -1 to quit: '))

   if check != -1:

       expenses += check

balance = budget - expenses

if balance < 0:

   print('\nYou haven\'t budgeted enough. You\'re going to be $', \

         format(-1 * balance, ',.2f'), ' short this month.', sep = '')

elif balance == 0:

   print('\nBe careful. You\'ve budgeted just enough to make it through ' +

         'the month.')

else:

   print('\nYou will have $', format(balance, ',.2f'), ' extra this month.', \

         sep = '')

You might be interested in
For a string s ∈ {0, 1} let denote the number represented by in the binary * s2 s numeral system. For example 1110 in binary has
Bogdan [553]

4657879790989o689ok,vm vm  vjl478o78o7t8o78o8y;l. ,nmhnjser467iu56uy56uh by

7 0
3 years ago
Write a program named as calcPrice.c that formats product information entered by the user and calculate the total amount of purc
Colt1911 [192]

Answer:

Here is the calcPrice.c program:

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

int main(void)  {  //start of main method

   int itemNo, month, day, year, quantity;  //declares variables to hold item number, quantity, and date

   float unitPrice; //declare variable to hold price per unit

   printf("Enter item number: ");  // prompts user to enter item number

   scanf("%d", &itemNo);  //reads item number from user and stores it in itemNo variable

   printf("Enter unit price: ");  // prompts user to enter unit price

   scanf("%f", &unitPrice);  //reads input unit price and stores it in unitPrice variable

   

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

   scanf("%d", &quantity);  //reads input quantity and stores it in quantity variable

   printf("Enter purchase date (mm/dd/yyyy): ");  //prompts user to enter purchase date

   scanf("%d/%d/%d", &month, &day, &year);  //reads input date and stores it in month, day and year variables

    float totalAmount = unitPrice * quantity;  //computes the total amount

   printf("\nItem\tUnit Price\tQTY\tPurchase Date\tTotal Amount\n");  //displays the item, unit price, qty, purchase data and total amount with tab space between each

   printf("%d\t$%5.2f\t%d\t%.2d/%.2d/%d\t$%5.2f\n", itemNo, unitPrice,quantity, month, day, year,totalAmount);   }    //displays the values of itemNo, unitPrice, quantity, month, day, year and computed totalAmount with tab space between each

Explanation:

Lets suppose user enters 583 as item number, 13.5 as unit price, 2 as quantity and 09/15/2016 as date so

itemNo = 583

unitPrice = 13.5

quantity = 2

month = 09

day = 15

year = 2016

totalAmount is computed as:

  totalAmount = unitPrice * quantity;

 totalAmount = 13.5* 2

totalAmount = 27.00

Hence the output of the entire program is:

Item    Unit Price      QTY     Purchase Date   Total Amount      

583     $  13.50           2           09/15/2016         $  27.00  

The screenshot of the program along with its output is attached.

4 0
3 years ago
Hello brainly users can someone help me out with this question thanks!!!
slavikrds [6]

Answer:

a medical journal/study from a licenced doctor on a website with .org

Explanation:

most medical journals from licenced doctors have .org in the end and are trusted

6 0
3 years ago
Read 2 more answers
How do I install free premium iOS apps?
Wittaler [7]

Answer:

you go to the ios store

Explanation:

5 0
3 years ago
Which of the following application architecture do you suggest as the best option for email for an organization? Consider small,
kykrilka [37]

Which of the following application architecture do you suggest as the best option for email for an organization? Consider small, medium and large organizations to provide your suggestions.

1. Two-tier client-server

2. web-based

Answer:

2. Web based

Explanation:

Web based applications provides cloud based email solutions provider that benefits small organisation as much as big organisations because the investment is minimal and affordable and gives no problem in deployment of resources to manage services with no risk.

It provides multiple point access by providing email solutions that enables multiple point of access gives rise to flexibility of access by members of the organisation.

It provides powerful admin control which makes management of email services easy and provides high security for services.

8 0
4 years ago
Other questions:
  • Email applications can either be local email client programs or web-based applications. Which application is an example of a loc
    13·2 answers
  • Parallel tangent and coincident are examples of what
    13·1 answer
  • Differences between barcode reader and character recognition devices​
    9·2 answers
  • Which of the following statements is true regarding Wireshark?
    11·1 answer
  • Suppose we have two threads inserting keys using insert() at the same time. 1. (5 points) Describe the exact sequence of events
    11·1 answer
  • If the signal is going through a 2 MHz Bandwidth Channel, what will be the maximum bit rate that can be achieved in this channel
    14·1 answer
  • Question #2
    7·1 answer
  • After inserting a video into your slide how can you test it
    11·1 answer
  • Technological advancements during the industrial age provided Americans with:
    13·1 answer
  • Write a program in C++ to Find the Average of the sum of prime numbers between 1 to any given number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!