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
Arte-miy333 [17]
2 years ago
14

The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons

for a candy bar or 3 coupons for a gumball. You prefer candy bars to gumballs. Write a program that inputs the number of coupons you win and outputs how many candy bars and gumballs you can get if you spend all of your coupons on candy bars first, and any remaining coupons on gumballs.
Computers and Technology
1 answer:
Lilit [14]2 years ago
3 0

Answer:

coupons = int(input("Enter the number of coupons you win: "))

candy_bars = int(coupons / 10)

gumballs = coupons % 10

print("Candy bars: " + str(candy_bars) + ", Gumballs: " + str(gumballs))

Explanation:

*The code is in Python.

Ask the user to enter the number of coupons

Calculate the number of candy bars, divide the coupons by 10 and typecst the result to int

Calculate the number of gumballs, use the modulo to find the remainder

Print the values

You might be interested in
Respond to the following in three to five sentences. Select the workplace skill, habit, or attitude described in this chapter (a
Katyanochek1 [597]

Answer:

communication and proactive

Explanation:

Communication is the most important thing and not only for a successful employee, is for successful life, in a company, there are a lot of people working in different areas, and sometimes we must interact with other departments to complete the task, a good communication help us to create a good experience and relationship with our partners, we're going to get efficient results.

If we want to ask more resources to our boss, we must show the needs and the benefits that company going to get, with a good presentation, inform and communication this can be easy to do, or if we are the boss, and we want to give trust our employees, we must have a good communication skills.

If we are proactive, we are going to result in almost every problem, in some companies the training is bad, we must learn process and attitudes for our job, some people are stingy with the knowledge, and we must find solution for our self, in this way we're going to be more independent, and our value increase in the company and even in the working market.

7 0
3 years ago
2 ways to assign a value to a variable
Art [367]
Assigning values at run time
Assigning values as command line argument, before execution of the program

4 0
3 years ago
Look at the picture lol
andrey2020 [161]

Answer:

Zoom in more please and than i can help

Explanation:

6 0
2 years ago
Read 2 more answers
If a user's input string matches a known text message abbreviation, output the unabbreviated form, else output: Unknown. Support
Molodets [167]

Answer:

Here is the JAVA program. I  have added a few more abbreviations apart from LOL and IDK.

import java.util.Scanner; // to take input from user

public class MessageAbbreviation {

public static void main(String[] args) { //start of main() function body

   Scanner input = new Scanner(System.in); // create object of Scanner

       String abbreviation= ""; //stores the text message abbreviation

/* In the following lines the abbreviation string type variables contain the un-abbreviated forms */

           String LOL = "laughing out loud";

           String IDK = "i don't know";

           String BFF = "best friends forever";

           String IMHO = "in my humble opinion";

           String TMI = "too much information";

           String TYT = "take your time";

           String IDC = "I don't care";

           String FYI = "for your information";

           String BTW = "by the way";

           String OMG = "oh my God";

//prompts the user to enter an abbreviation for example LOL

           System.out.println("Input an abbreviation:" + " ");

           if(input.hasNext()) { // reads the abbreviation form the user

           abbreviation= input.next(); }

// scans and reads the abbreviation from user in the abbreviation variable

/*switch statement checks the input abbreviation with the cases and prints the un abbreviated form in output accordingly. */

    switch(abbreviation) {

       case "LOL" : System.out.println(LOL);

                    break;

       case "IDK" : System.out.println(IDK);

                    break;

       case "BFF" : System.out.println(BFF);

                    break;

       case "IMHO": System.out.println(IMHO);

                     break;

       case "TMI": System.out.println(TMI);

                     break;

       case "TYT": System.out.println(TYT);

                     break;

       case "IDC": System.out.println(IDC);

                     break;

       case "FYI": System.out.println(FYI);

                     break;

       case "BTW": System.out.println(BTW);

                     break;

       case "OMG": System.out.println(OMG);

                     break;

                     

       default    : System.out.println("Unknown"); } } }

Explanation:

The program first prompts the user to enter an abbreviation. Lets say the user enters LOL. Now the switch statement has some cases which are the conditions that are checked against the input abbreviation. For example if the user enters LOL then the following statement is executed:

case "LOL" : System.out.println(LOL);

This means if the case is LOL then the message ( un abbreviated form) stored in the LOL variable is displayed on output screen So the output is laughing out loud.

Anything else entered other than the given abbreviations will display the message: Unknown

The output is attached as screen shot.

5 0
3 years ago
Read 2 more answers
What five safety habits are you using for the internet?
forsale [732]

Answer: Keep Personal Information Professional and Limited.

Keep Your Privacy Settings On.

Practice Safe Browsing.

Make Sure Your Internet Connection is Secure.

Be Careful What You Download.

Choose Strong Passwords.

Explanation:that’s what is think

4 0
2 years ago
Other questions:
  • Write any 2 differences between implicit variables and explicit variables.​Plz tell :' (
    10·1 answer
  • Different units of CPU ?
    12·1 answer
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • The process of encoding messages or information in such a way that only authorized parties can read it is called ____________.
    7·1 answer
  • ​When preparing a representative sample from a list of 200 customers who complained about errors in their statements, a _____ co
    7·1 answer
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • It's important to understand that even information systems that do not use computers
    14·1 answer
  • given the variables temperature and humidity, write an expression that evaluates to true if and only if the temperature is great
    11·1 answer
  • 4.2.5 codehs text messages answer
    9·1 answer
  • From which os did windows xp evolve?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!