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
IgorLugansk [536]
2 years ago
5

Write a program that simulates a fishing game. In this game, a six-sided die is rolled to determine what the user has caught. Ea

ch possible item is worth a certain number of fishing points. The points will remain hidden until the user is finished fishing, and then a message is displayed congratulating the user depending on the number of fishing points gained.
Computers and Technology
1 answer:
m_a_m_a [10]2 years ago
3 0

Answer:

Answered below

Explanation:

//Python code

numberOfCasts = 3

j = 0

fishingPoints = 0

sum = 0

while j < numberOfCasts:

dieNum = randint(1 , 6)

if dieNum ==1:

fishingPoints = 2

elif dieNum == 2:

fishingPoints = 4

elif dieNum == 3:

fishingPoints = 6

elif dieNum == 4:

fishingPoints = 8

elif dieNum == 5:

fishingPoints = 10

elif dieNum ==6:

fishingPoints = 12

sum += fishingPoints

j++

if sum > 30:

print ("Great catch")

elif sum > 10 and sum <= 30:

print("Good catch")

else:

print ("Bad day")

You might be interested in
write a function that counts the number of times the value of y occurs in the first n values in array x. y is an integer variabl
mixer [17]

Answer:

Following are the function of count:

void count(int y,int x[],int n) // function definition of count

{

int k,count=0;  // variable declaration

for(k=0;k<n;++k) // iterating over the loop

   {

   if(x[k]==y) //check the conndition number of times the value of y occurs

   {

   count++; // increment of count by 1

   }

   }

Explanation:

Following are the code in c language

#include <stdio.h> // header file  

void count(int y,int x[],int n) // function definition of count

{

int k,count=0;  // variable declaration

for(k=0;k<n;++k) // iterating over the loop

   {

   if(x[k]==y) //check the conndition number of times the value of y occurs

   {

   count++; // increment of count by 1

   }

   }

   printf(" the number of times the value of y occurs :%d",count); // display count value

   }

int main() // main method

{

   int x[100],y,n,k; // variable declarartion

   printf(" Enter the number of terms n :");

   scanf("%d",&n); // input the terms

   printf(" Enter the array x :");

   for(k=0;k<n;++k) // input array x

   {

   scanf("%d",&x[k]);

   }

   printf("Enter the value of y:");

   scanf("%d",&y);// input value y by user

    count(y,x,n); // calling function

   return 0;

}

In the given program we declared an array x ,variable  y and n respectively Input the array x ,y,n  by user after that we call the function count .In the count function we iterate the loop from o position to array length-1 and check the number of times the value of y occurs by using if statement  i.e  if(x[k]==y) if the condition of if block is true then we increment the count variable Otherwise not .Finally display the count variable which describe the number of count.

Output

Enter the number of terms n :5

1

2

2

56

5

Enter the value of y:2

the number of times the value of y occurs :2

Enter the number of terms n :5

1

2

3

56

5

Enter the value of y:26

the number of times the value of y occurs :0

7 0
2 years ago
Which of the following is a good question to ask during an informational interview?
grin007 [14]
How do you know your information is valid?
8 0
3 years ago
Read 2 more answers
VLSI is the process of creating an integrated circuit (IC) by combing thousands of transistors into a single chip. There are two
malfutka [58]

Answer:

An FPGA is a field programmable gate array. It could be "programmed" to do certain task, but don't mistake it with a microprocessor. When programming an FPGA, you're actually changing it's physical structure, the logic gates inside the FPGA, to do the task for you. Therefore, unlike a microprocessor which has to run through a series of command, an FPGA could be rewired to run at a much faster and more efficient rate.

FPGA is good for testbenching and are budget friendly since they can be reprogrammed over and over again in case you messed up. However, they can be quite big and bulky, so they are not suitable for mass production.

ASIC in the other hand can be compact to a small size. ASIC are pretty much the IC chips that you use, like your Intel CPU or LM7000 series chips. However, the process of making them that small is irreversible, so if you messed up, you gotta throw away the whole batch. This make them expensive to make, but their small size and production process allows them to be made in bulk.

Both FPGA and ASIC are good for power consumption and speed because you're actually designing their physical circuit layout, so if your design is efficient then the product will be efficient in both speed and power as well.

In Summary, you design and test your circuit using an FPGA first. Then you send that design to a production company and they will use that design to mass produce it as a small chip.

7 0
3 years ago
If a computer system does not have a graphics card installed in a motherboard's PCIe slot, which component handles video calcula
Klio2033 [76]

Answer:The Cpu or a chip on the Motherboard

Explanation: yore welcome

5 0
3 years ago
The ______________________ denotes the application software and technology that concerns a wide range of topics from the data ma
zhuklara [117]

Answer:

System/application Domain.

Explanation:

System/application domain represents the technology and  software that is tasked to do diverse subjects from the data management to the systems that processes data or information.

Particular application domain has it's own specific virtual address in which the resources for the application domain are present that uses the address space.

8 0
3 years ago
Other questions:
  • Does toontown rewritten carry spyware or malware
    9·1 answer
  • What do you call the number that is used as an index to pinpoint a specific element within an array?
    14·1 answer
  • In your own words, describe the advantages and disadvantages of the auto-negotiation protocol used in Ethernet communications.
    6·1 answer
  • Process is useful for a quick turnaround in game development?
    13·2 answers
  • List the three control problems associated with competingprocesses and briefly define each.
    7·1 answer
  • Write a recursive function that returns 1 if an array of size n is in sorted order and 0 otherwise. Note: If array a stores 3, 6
    6·1 answer
  • Do you think people accept poor quality in information technology projects and products in exchange for faster innovation? What
    5·1 answer
  • Identify 5 products/services needed by the people in our current situation.<br>​
    6·1 answer
  • Which statement is true about hacking?
    11·2 answers
  • Where can formatting features be found ?! Need help asp !‍♀️
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!