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
Solnce55 [7]
3 years ago
14

Hot Dog Cookout Calculator Assume hot dogs come in packages of 10, and hot dog buns come in packages of 8. Write a program that

calculates the number of packages of hot dogs and the number of packages of hot dog buns needed for a cookout, with the minimum amount of leftovers. The program should ask the user for the number of people attending the cookout and the number of hot dogs each person will be given. The program should display the following details: 1. The minimum number of packages of hot dogs required 216.2. The minimum number of packages of hot dog buns required.3. The number of hot dogs that will be left over.4. The number of hot dog buns that will be left over.

Computers and Technology
1 answer:
NARA [144]3 years ago
7 0

Answer:

Following are the code to this question:

person= int(input("Input the value who attend the cookout: "))#defining a variable person for input value

Given_hotdog = int(input("Input the value of hotdog, that each person will take: "))#defining a variable Given_hotdog for input value

hotdogs = person* Given_hotdog #calculating the total value of hotdogs

# calculating the numbers of the package, that holds require hotdog and buns

package_hotdog=int(hotdogs/10)+1# calculating hotdog packages

bun_package=int(hotdogs/8)+1# calculating buns package

left_hotdogs= package_hotdog*10 -hotdogs# calculating left hotdogs

left_buns=bun_package*8-hotdogs# calculating left buns

print("Total Hotdogs",hotdogs)#print total hotdogs value

print("The Minimum number of packages require for hotdogs: ", package_hotdog)#print require hotdogs value

print("The Minimum number of packages require for buns: ", bun_package)#print require buns value

print("Number of left hotdogs: ", left_hotdogs)#print left hotdogs value

print("Number of left buns: ", left_buns)#print left buns value

Output:

please find the attached file.

Explanation:

In the above-given code, the "person and Given_hotdog" variable is declared, which is used to take input from the user end and in the "hotdogs" variable we calculate its total value.

  • In the next step, "package_hotdog and bun_package" is declared, which uses the "hotdogs" variable to calculate its value.  
  • At the last step, the "left_hotdogs and left_buns" variable is declared, which uses the above variable for calculating the value and use the print method to print its value.

You might be interested in
Write a C++ program that reads from the standard input and counts the number of times each word is seen. A word is a number of n
Rufina [12.5K]

Answer:

#include <stdio.h>

#include <string.h>

#include <ctype.h>

 

struct detail

{

   char word[20];

   int freq;

};

 

int update(struct detail [], const char [], int);

 

int main()

{

   struct detail s[10];

   char string[100], unit[20], c;

   int i = 0, freq = 0, j = 0, count = 0, num = 0;

 

   for (i = 0; i < 10; i++)

   {

      s[i].freq = 0;

   }

   printf("Enter string: ");

   i = 0;

   do

   {

       fflush(stdin);

       c = getchar();

       string[i++] = c;

 

   } while (c != '\n');

   string[i - 1] = '\0';

   printf("The string entered is: %s\n", string);

   for (i = 0; i < strlen(string); i++)

   {

       while (i < strlen(string) && string[i] != ' ' && isalnum(string[i]))

       {

           unit[j++] = string[i++];

       }

       if (j != 0)

       {

           unit[j] = '\0';

           count = update(s, unit, count);

           j = 0;

       }

   }

 

   printf("*****************\nWord\tFrequency\n*****************\n");

   for (i = 0; i < count; i++)

   {

       printf("%s\t   %d\n", s[i].word, s[i].freq);

       if (s[i].freq > 1)

       {

           num++;

       }

   }

   printf("The number of repeated words are %d.\n", num);

 

   return 0;

}

 

int update(struct detail s[], const char unit[], int count)

{

   int i;

 

   for (i = 0; i < count; i++)

   {

       if (strcmp(s[i].word, unit) == 0)

       {

           s[i].freq++;

 

           return count;

       }

   }

   /*If control reaches here, it means no match found in struct*/

   strcpy(s[count].word, unit);

   s[count].freq++;

 

   /*count represents the number of fields updated in array s*/

   return (count + 1);

}

4 0
4 years ago
Use the drop-down menus to complete statements about archiving and backing up data fileArchiving data files manages the size of
svetoff [14.1K]

Answer:

Archiving data files manages the size of a mailbox for  

✔ local

storage.

Creating an Outlook data file  

✔ protects

data files in storage on a computer.

Explanation:

Because its right.

3 0
3 years ago
Read 2 more answers
Select all the correct answers.
Elden [556K]

Answer: Bulleted or numbered lists, presenting data in tables, and the formatting one.

Explanation: I’m taking the test and i’m pretty sure that’s right, lmk if you got a better answer though!

5 0
3 years ago
Read 2 more answers
The first window displayed when you install opensuse is the ____ window.
Jlenok [28]
Is the <span>Boot Options window.</span>
3 0
3 years ago
Starbucks offers an app that allows remote ordering, free Wi-Fi in stores, and a loyalty program where customers can earn a free
Vinil7 [7]
<span>Starbucks is employing a Brand Loyalty and Convenience strategy that seeks to not only make it convenient for customers to use their services, but also builds loyalty to ensure that customers keep coming back. These programs add value to Starbucks as they increase residual sales and customer loyalty.</span>
4 0
4 years ago
Other questions:
  • Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the HeightF
    5·1 answer
  • What chage command should you enter at the comman prompt to set the password to jsmith expire after 60 days and gives a warning
    12·1 answer
  • The ______________________ are incident management personnel that the incident commander or unified command assign to directly s
    10·1 answer
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    8·2 answers
  • Darian has a gourmet cupcake business and needs a website to compete with the other bakeries in his area. He has a Google My Bus
    15·1 answer
  • You have a computer at home. The computer is connected to the Internet through a dial-up connection. Every time you connect to t
    7·1 answer
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • Linux distributions automatically come with a native software firewall.TrueFalse
    13·1 answer
  • Why would an information systems security practitioner want to see network traffic on both internal and external network traffic
    5·1 answer
  • Consider the following method.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!