Create a console application YourLastNameAlP3SC and use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople eamed salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount. Also use a while loop. If the gross sale is 0 or negative, the while loop terminates.): a) $200–299 b) $300–399 c) $400–499 d) $500–599 e) $600-699 f) $700-799 e) $800-899 h) $900–999 ) $1,000 and over Your program's output should look like this picture. PS C: \Users\Shao\Desktop\COMP316eShao\Assignment1\ShaoA1P35c> dotnet run Assignment1 Problem3_by Guifeng Shao Enter sales amount (negative to end): 900 Enter sales amount (negative to end): 9000 Enter sales amount (negative to end): 9000e Enter sales amount (negative to end): 1000 Enter sales amount (negative to end): 1500 Enter sales amount (negative to end): 2000 Enter sales amount (negative to end): 4000 Enter sales amount (negative to end): 6e0e Enter sales amount (negative to end): 7500 Enter sales amount (negative to end): 55e0 Enter sales amount (negative to end): 3300 Enter sales amount (negative to end): -1 Number Range $200-$299 $300-$399 $400-$499 $500-$599 $600-$699 $700-$799 2 2 $8ee-$899 $90e-$999 $10ee and aver 2

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question

C#

Create a console application YourLastNameAlP3SC and use a one-dimensional aray to solve the
following problem: A company pays its salespeople on a commission basis. The salespeople receive $200
per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5,000 in
sales in a week receives $200 plus 9% of $5,000, or a total of $650. Write an application (using an array
of counters) that determines how many of the salespeople eamed salaries in each of the following ranges
(assume that each salesperson's salary is truncated to an integer amount. Also use a while loop. If the
gross sale is 0 or negative, the while loop terminates.):
a) $200-299
b) $300-399
c) $400-499
d) $500-599
e) $600-699
f) $700-799
2) $800-899
h) $900-999
1) $1,000 and over
Your program's output should look like this picture.
PS C: \Users\Shao\Desktop\COMP316eShao\Assignment1\ShaoA1P3SC> dotnet run
Assignmenti Problem3_by Guifeng Shao
Enter sales amount (negative to end): 900
Enter sales amount (negative to end): 9000
Enter sales amount (negative to end): 9000e
Enter sales amount (negative to end): 1000
Enter sales amount (negative to end): 1500
Enter sales amount (negative to end): 2000
Enter sales amount (negative to end): 4000
Enter sales amount (negative to end): 6000
Enter sales amount (negative to end): 7500
Enter sales amount (negative to end): 5500
Enter sales amount (negative to end): 3300
Enter sales amount (negative to end): -1
Number
Range
$280-$299
$300-$399
$400-$499
$500-$599
$600-$699
$700-$799
2
2
1
1
1
$800-$899
$900-$999
$1000 and aver
1
2
Transcribed Image Text:Create a console application YourLastNameAlP3SC and use a one-dimensional aray to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople eamed salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount. Also use a while loop. If the gross sale is 0 or negative, the while loop terminates.): a) $200-299 b) $300-399 c) $400-499 d) $500-599 e) $600-699 f) $700-799 2) $800-899 h) $900-999 1) $1,000 and over Your program's output should look like this picture. PS C: \Users\Shao\Desktop\COMP316eShao\Assignment1\ShaoA1P3SC> dotnet run Assignmenti Problem3_by Guifeng Shao Enter sales amount (negative to end): 900 Enter sales amount (negative to end): 9000 Enter sales amount (negative to end): 9000e Enter sales amount (negative to end): 1000 Enter sales amount (negative to end): 1500 Enter sales amount (negative to end): 2000 Enter sales amount (negative to end): 4000 Enter sales amount (negative to end): 6000 Enter sales amount (negative to end): 7500 Enter sales amount (negative to end): 5500 Enter sales amount (negative to end): 3300 Enter sales amount (negative to end): -1 Number Range $280-$299 $300-$399 $400-$499 $500-$599 $600-$699 $700-$799 2 2 1 1 1 $800-$899 $900-$999 $1000 and aver 1 2
Create a console application YourLastNameAlP4GC and which runs 1,000,000 games of craps (See Fig.
7.7) and answers the following questions:
a) How many games are won on the first rll, second roll, ., twentieth roll and after the twentieth
roll?
b) How many games are lost on the first roll, second roll, ., twentieth roll and after the twentieth
roll?
c) What are the chances of winning at craps? [Note: You should discover that craps is one of the
fairest casino games. What do you suppose this means?]
d) What is the average length of a game of craps?
e) Do the chances of winning improve with the length of the game? ( check YES or NO)
Your program's output should look like this picture.
PS C: \Users\Shao\Desktop\COMP316eshao\Assignment1\ShaoA1P4GC> dotnet run
Assignment1 Problem4 by Guifeng Shao
roll#
won
lost
#1
221988
111905
# 2
77141
111221
# 3
55082
79658
# 4
39234
57490
#5
28288
40979
#6
20031
29421
# 7
14292
21212
#8
10380
15293
#9
7403
11092
#10
5170
7964
#11
3778
5811
#12
2715
4093
#13
1952
2917
#14
1460
2178
#15
1082
1695
#16
747
1205
#17
520
908
#18
396
596
#19
292
460
317
904
# 20
204
#20+
526
The chances of winning are 492681 / 1000000 = 49.27%
The average game length is 3.37 rolls.
PS C:\Users\Shao\Desktop\COMP3160Shao\Assignment1\ShaoA1P4GC>
Transcribed Image Text:Create a console application YourLastNameAlP4GC and which runs 1,000,000 games of craps (See Fig. 7.7) and answers the following questions: a) How many games are won on the first rll, second roll, ., twentieth roll and after the twentieth roll? b) How many games are lost on the first roll, second roll, ., twentieth roll and after the twentieth roll? c) What are the chances of winning at craps? [Note: You should discover that craps is one of the fairest casino games. What do you suppose this means?] d) What is the average length of a game of craps? e) Do the chances of winning improve with the length of the game? ( check YES or NO) Your program's output should look like this picture. PS C: \Users\Shao\Desktop\COMP316eshao\Assignment1\ShaoA1P4GC> dotnet run Assignment1 Problem4 by Guifeng Shao roll# won lost #1 221988 111905 # 2 77141 111221 # 3 55082 79658 # 4 39234 57490 #5 28288 40979 #6 20031 29421 # 7 14292 21212 #8 10380 15293 #9 7403 11092 #10 5170 7964 #11 3778 5811 #12 2715 4093 #13 1952 2917 #14 1460 2178 #15 1082 1695 #16 747 1205 #17 520 908 #18 396 596 #19 292 460 317 904 # 20 204 #20+ 526 The chances of winning are 492681 / 1000000 = 49.27% The average game length is 3.37 rolls. PS C:\Users\Shao\Desktop\COMP3160Shao\Assignment1\ShaoA1P4GC>
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,