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
Hatshy [7]
3 years ago
10

How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing

on each option is equal. Simulate using the spinner 15 times and reporting the resulting color."?
Computers and Technology
1 answer:
melisa1 [442]3 years ago
7 0
What you need to do is to generate a random number between 1 and 4(or0 and 3) 15 times. Each time you generate a number, you figure out which number it is and keep track of how many times you’ve seen that number. At the end, print out how many of each number you got.

Good luck!
You might be interested in
What does NIC stand for?
evablogger [386]
Network Interface Controller
6 0
3 years ago
Write a program sum.cpp that reads a sequence of integers from cin, and reports their sum. Example If you have a file numbers.tx
Katarina [22]

Answer:

The solution code is as follows:

  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7.    ifstream data;
  8.    float number;
  9.    float sum = 0;
  10.    
  11.    data.open("numbers.txt");
  12.    
  13.    while (data >> number) {
  14.        sum = sum + number;
  15.    }
  16.    cout<<sum;
  17.    return 0;
  18. }

Explanation:

Firstly, we create a ifstream object, <em>data</em> (Line 9). Then we can use the ifstream object to open the "numbers.txt" (Line 13) and use while loop to traverse through the number in the text file line by line (Line 15). White the loop is ongoing the number in each line is read by >> operator in a similar way to cin and then add each read number to sum variable (Line 16).

At last, display the output (Line 18).

8 0
3 years ago
1
Vitek1552 [10]

Answer:

A

Explanation:

.

.stack 4096

ExitProcess PROTO, dwExitCode:DWORD

.data

Sun=0

Mon=1

Tue=2

Wed=3

Thu=4

Fri=5

Sat=6

warray BYTE Sun, Mon, Tue, Wed, Thu, Fri, Sat

INVOKE ExitProcess, 0

7 0
3 years ago
I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
loris [4]

Answer:

true

Explanation:

3 0
3 years ago
Read 2 more answers
List the rules to keep in mind as you declare a variable in VB.NET
Eddi Din [679]
- What is your variable scope? Ie., in what parts of the program do you need it?
- Is it a value type or a reference type. Reference types must always be "newed". Value types are more expensive to pass as parameters.
- Does the type implement IDisposable? Then you should use it in a using { } clause.
- Is the type immutable (like string or DateTime)? Then making changes to it is more expensive than you may think.
7 0
3 years ago
Other questions:
  • The device that concerts one type of signal to another is what​
    7·1 answer
  • apple and adobe are in disagreement about the use of __________ to create apps for the iphone and ipad?
    10·1 answer
  • Write two examples of hard copy output?​
    9·1 answer
  • How do u answer questions on brainly if ur on the app and on a phone. For me there is no answer button :(
    8·1 answer
  • I need help with this line of code:
    5·1 answer
  • In minecraft Education Edition what is the crafting recipe for Balloons and Glow sticks?
    13·2 answers
  • Who is the father of computer?​
    14·1 answer
  • 1. Write the full forms of the following.
    8·2 answers
  • Who can answer me this one plss little urgent
    15·1 answer
  • High-level languages must be translated into machine language before they can be executed. _________________________
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!