Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java please. 4.30 Lab 10d: Marbles This program will answer the question How many combinations can you make with 5 marbles?. This will be

In java please.image text in transcribed

4.30 Lab 10d: Marbles This program will answer the question "How many combinations can you make with 5 marbles?". This will be determined with three given values to correspond to the number of marbles for three different colors. The three colors are red, blue and green. The user will input values for how many marbles you will have for each color in the same order the colors were just listed. The user will need to enter a value greater than 0 for each number otherwise the program will return O combinations. Also, the program will return 0 combinations if you have less than 5 marbles to begin with. The program will print out each combination in the following format: "Red: [numRed], Blue: [numBlue], Green: [numGreen] In addition, your program should also print out the total number of combinations. Consult the example input and output for any questions regarding the format of the printouts You will use for loops to complete this task. Example input: 3 Example output: Red: 0, Red: 0, Blue: 3, Green: 2 Red: 1, Blue: 1, Green Red: 1, Bl Red: 1, Blue: 3, Green Red: 2, Blue: 0, Green: Red: 2, Red: 2, Blue: 2, Green: 1 Red: 2, Blue: 3, Green: Red: 3, Blue: 0, Green: 2 Red: 3, Blue: 1, Green Red: 3, Blue: 2, Green: 12 Blue: 2, Green: 3 ue: 2, Green: : 1 Blue: 1, Green: 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago