(Pick 5 Lotto) Write a program to simulate a pick-5 lottery game. Your program generates and stores 5 distinct random integers between 1 and 9 (inclusive) into an array. The program then prompts the user to enter 5 distinct integers between one and nine and stores the numbers into a second array. The program then compares and determines whether the two arrays are identical. If the two arrays are identical, then the user wins the game; otherwise, the program outputs the number of matching digits and their position in the array.

Use default_random_engine and unitform_int_distribution to generate the random numbers. See discussions to see engines and distributions details.

Answers

Answer 1

The way to write the program will be:

#include <stdio.h>

#include <stdlib.h>

int main(void) {

       int seed;

       printf("Enter an integer random seed: ");

       scanf("%d", &seed);

       srand(seed);

       int comp_nums[5], user_nums[5];

       int matchCount = 0;

       int i=0;

       printf("To play the Pick-5 game, enter five integers between 1 and 9 (inclusive): ");

       for(i=0; i<5; i++) {

               scanf("%d", &user_nums[i]);

       }

       printf("\n");

       // generate comp_num

       for(i=0; i<5; i++) {

               comp_nums[i] = rand() % 9 + 1;

               if(comp_nums[i] == user_nums[i]) {

                       matchCount++;

               }

       }      

       if(matchCount == 5) {

               printf("\nCongratulations!!! You WIN!!!\n");

       } else if(matchCount == 0) {

              printf("You didn't match any numbers!\n") ;

       } else {

               printf("\nYou only matched %d numbers.\n", matchCount);

               printf("Your numbers matched the Pick-5 numbers at position(s): ");

               for(i=0; i<5; i++) {

                       if(comp_nums[i] == user_nums[i]) {

                               printf("%d ", i);

                       }

               }      

               printf("\n");

       }

       printf("The winning numbers are: ");

       for(i=0; i<5; i++) {

               printf("%d ", comp_nums[i]);

       }

       printf("\n");

       return 0;

}

How will the program be written?

The appropriate steps include:

Define what the program should be able to do. It's also important to visualize the program running on the computer.

Then create a model of the program, check for logical errors and then write the program source code.

Learn more about program on:

https://brainly.com/question/26642771

#SPJ1


Related Questions

Describe three ways in which your activities affect the environment.

Answers

Answer:

Opening loud music , cleaning and ... I don't know

Citi bike is an example of which arena of technology

Answers

Citi bike is an example of the arena of technology called Lyft.

What is Citi Bike?

Citi Bike is a privately owned public bicycle-sharing system that operates in the Bronx, Brooklyn, Manhattan, and Queens boroughs of New York City, as well as Jersey City and Hoboken, New Jersey.

It was managed by Motivate (previously Alta Bicycle Share), with former Metropolitan Transportation Authority CEO Jay Walder as CEO, until September 30, 2018, when the firm was bought by Lyft. Lyft technology is used in the system's bikes and stations.

The system surpassed 50 million rides in October 2017 and will reach 100 million rides in July 2020.

Learn more about Lyft:
https://brainly.com/question/28547867
#SPJ1

Fill in the blank: If a data analyst is using data that has been _____, the data will lack integrity and the analysis will be faulty.
-public
-compromised
-wide
-clean

Answers

Option C: Compromised

If a data analyst is using data that has been compromised, the data will lack integrity and the analysis will be faulty.

What is Data Quality ?

A data analyst is a professional who gathers, organizes, and analyses information from various sources to assist an organization in meeting its objectives.

Data analysts use logic, statistical techniques, and computer programming to convert numbers into information that can be used by an organization to improve workflow and business processes.

One important goal of analysis is to determine which data is important and which should be given less weight. Data analysts are often responsible for data quality and preparing reports for internal and external stakeholders in many organizations.

To know more about data analyst, visit: https://brainly.com/question/29384413

#SPJ4

Which of the following is given to a notification from a firewall that a specific event or packet was detected?
a. management interface
b. rules
c. alert
d. anomaly-based detection

Answers

Option C Alert

How do firewall work?A firewall is a piece of network security equipment that keeps an eye on both incoming and outgoing network traffic and allows or denies data packets in accordance with a set of security rules. Its goal is to create a physical barrier between your internal network and incoming traffic from outside sources (like the internet), blocking unwanted traffic like that of hackers and viruses.In order to stop attacks, firewalls thoroughly examine incoming communication in accordance with pre-established criteria and filter traffic from untrusted or dubious sources. Firewalls monitor traffic at a computer's ports, which are the entry points via which data is shared with external devices. Such a statement might read, "Source address 172.18.1.1 is allowed to reach destination 172.18.2.1 through port 22."Consider port numbers as the rooms in the home and IP addresses as the houses. It is further filtered such that persons inside the house are only permitted to access specific rooms (destination ports), depending on whether they are the owner, a child, or a visitor. Only trusted people (source addresses) are allowed to enter the house (destination address) at all. While kids and visitors are not permitted in any room (or port), the owners are permitted to enter a specific set of rooms (specific ports).

To learn more about IP addresses refer https://brainly.com/question/24475479

#SPJ4

match each authentication protocol on the left with its unique characteristic on the right. (each protocol may be used more than once).

Answers

Below is the authentication protocol on the left with its unique characteristic on the right.

Sends a user's credentials over UDP:

Remote Authentication Dial-In Service (RADIUS)

Sends a user's credentials over TCP:

Terminal Access Controller Access-Control System (TACACS+)

Is an important part of Windows Active Directory:

Kerberos

Provides a trusted Key Distribution Center (KDC):

Kerberos

Only encrypts the password:

Remote Authentication Dial-In Service (RADIUS)

What is Authentication protocol?

An authentication protocol allows the receiving party (such as a server) to confirm another party's identity (such as a person using a mobile device to log in). To verify users, almost every computer system employs some form of network authentication.

To know more about Authentication protocol, visit: https://brainly.com/question/28593089

#SPJ4

Task 1. Client-Side Program (25 marks)
Implement the client-side requirements (non-graphical user interface) and then provide code snippets for each function with clear explanations/comments of key statements used. The client-side would enter the Bill Number, the Customer Type, and the consumption via keyboard. The client will then forward the Customer Type and consumption to the server. Include input field. validation wherever possible.

i. Create a thread using extending thread class or implementing a runnable interface and implement a run method.

ii. Request connection to the server.

iii. Accept and forward the necessary data to the server.

iv. Receive and display the results from the server.

v. Close the connection after use.

vi. Create a main class called custClient, define the main method, creation of client object, and start the thread.​

Answers

Written in C++ language. Remember to provide the object's parameters before compiling the program.

#include <bits/stdc++.h>

//Our Client class derived from std::thread class.

class ClientClass : public std::thread {

public:

   // Constructor

   ClientClass(int socket, const std::string& server) : c_socket(socket), s(server) {

       ;;

   }

   //run() Method

   void run(){

       //Connection

       connect(c_socket, s);

       //Data input

       std::string bill, customer; int consumption; std::cin >> bill >> customer >> consumption;

       //Check if it's valid.

       if(bill == "" || customer == "" || consumption == nullptr) std::cerr << "Error has occured!" << std::endl;

       //Sending

       send_data(c_socket, bill, customer, consumption);

       std::string tmp = receive_data(c_socket);

       std::cout << tmp << std::endl;

       //End.

       close_connection(c_socket);

   }

private:

   //Variables

   int c_socket; std::string s;

};

int main(int argc, char* argv[]) {

   ClientClass client(**, **);

   client.run();

   return 0;

}

The thread using extending thread class or implementing a runnable interface and implement a run method is given in explanation part.

What is programming?

Writing code to support certain activities in a computer, application, or software programme and giving them instructions on how to do is known as computer programming.

In addition to enabling you to direct machines, learning to code also teaches you abstract reasoning and problem-solving skills. In actuality, creativity and the ability to solve problems are essential traits for successful computer programming.

The program can be:

class ClientClass : public std::thread {

public:

  ClientClass(int socket, const std::string& server) : c_socket(socket), s(server) {

      ;;

  }

  //run() Method

  void run(){

      //Connection

      connect(c_socket, s);

      //Data input

      std::string bill, customer; int consumption; std::cin >> bill >> customer >> consumption;

      if(bill == "" || customer == "" || consumption == nullptr) std::cerr << "Error has occured!" << std::endl;

      send_data(c_socket, bill, customer, consumption);

      std::string tmp = receive_data(c_socket);

      std::cout << tmp << std::endl;

      close_connection(c_socket);

  }

private:

  int c_socket; std::string s;

};

int main(int argc, char* argv[]) {

  ClientClass client(**, **);

  client.run();

  return 0;

}

Thus, this can be the program for the given scenario.

For more details regarding programming, visit:

https://brainly.com/question/11023419

#SPJ2

my college is the name of the central piedmont system that is the main point of access for online registration, financial aid resources, looking up your gpa, reviewing your class schedule and planning your degree.

Answers

My college is the name of the central piedmont system that is the main point of access for online registration, financial aid resources, looking up your gpa, reviewing your class schedule and planning your degree is true.

What is central piedmont system?In Charlotte, North Carolina, there is a public community college called Central Piedmont Community College. Central Piedmont is the second-largest community college in the North Carolina Community College System and the biggest in the Charlotte metro area, with an annual enrollment of over 40,000 students.The student must have an overall Grade Point Average (GPA) of at least 2.0 on a scale of 4.0 and a grade of "C" or better in all CAA courses in order to be qualified for the transfer of credits under the CAA. They must also graduate from the community college with an Associate in Arts (AA) or Associate in Science (AS) degree. With the following conditions, the Transfer Assured Admissions Policy (TAAP) under the CAA guarantees admission to at least one of the 16 UNC institutions: Admission is not guaranteed to a particular campus, program, or major.The CAA is refined and made minor revisions under the direction of the Transfer Advisory Committee. Prescribed Coursework Report is referred to as PCR. All of your courses that satisfy the prerequisite coursework criteria are listed in detail.

The complete question is,

my college is the name of the central piedmont system that is the main point of access for online registration, financial aid resources, looking up your gpa, reviewing your class schedule and planning your degree. True or false.

To learn more about central piedmont system refer to:

https://brainly.in/question/882176
#SPJ4

Observe the table BEVERAGE:
BEVERAGE
BevID BevName BevType
B1 ZenMaster Tea
B2 LillyChai Tea
B3 AwakeBrew Coffee
B4 MintMild Tea
B5 MintBlast Tea
B6 RoastPal Coffee
What will be the result of the following query on table BEVERAGE?
SELECT * from BEVERAGE;
StudentID column of the relation BEVERAGE will be displayed
The entire relation BEVERAGE will be displayed
First record of the relation BEVERAGE will be displayed
Last record of the relation BEVERAGE will be displayed

Answers

The entire relation BEVERAGE will be displayed.

How to use SELECT?

The entire relation BEVERAGE will be displayed. The query SELECT * from BEVERAGE will retrieve all rows and columns from the BEVERAGE table, resulting in the display of the entire table.

This is because the * in the SELECT clause indicates that all columns should be selected, and the FROM clause specifies the table from which the data should be retrieved.

No conditions or filters are specified in the query, so all rows in the table will be included in the result.

To Know More About SQL, Check Out

https://brainly.com/question/29659731

#SPJ1

You are a security administrator for an enterprise. You were asked to implement a cloud app security function in your enterprise network so that login attempts from identified threat actors can be restricted. Which of the following cloud app security function should you use?
Risky IP address

Answers

Note that as a security administrator for an enterprise if you were asked to implement a cloud app security function in your enterprise network so that login attempts from identified threat actors can be restricted. The function to use is: "Risky IP address"

What is cloud app secrutity?

Cloud application security (also known as cloud app security) is a set of rules, processes, and controls that allow businesses to safeguard their apps and data in collaborative cloud settings. Cloud solutions are pervasive in today's businesses.

It delivers comprehensive visibility, control over data movement, and advanced analytics to detect and mitigate cyber threats across all Microsoft and third-party cloud services. Microsoft Defender for Cloud Apps is developed for security professionals and directly connects with popular Microsoft products.

The many kinds of Cloud App Security Services are as follows:

Preventing Data LossManagement of Identity and AccessEmail SafetyWeb SafetyDetection of IntrudersEncryption

Learn more about IP addresses:
https://brainly.com/question/14616784
#SPJ1

in a data set that is skewed to the left the outliers cause the mean to be larger than both the median and the mode - true or false

Answers

Answer:

true

Explanation:

the answer to ur question is true

7.2.5 height in meters

Can someone tell me what’s wrong and the correct code please

Answers

Answer:

Hello! You have a close(but not open) parentheses on line 10. Let me know if you get another error! Hope this works!

intrusion detection system provides packet filtering that operates on tcp/ip headers only and examines correlation among multiple packets through port scanning, network mapping and dos attacks.

Answers

False. An Intrusion Detection System (IDS) provides packet filtering that operates on more than just TCP/IP headers.

In addition to port scanning, network mapping, and DOS attacks, an IDS will also analyze the payload of packets for any malicious content, as well as look for other common indicators of malicious activity, such as unexpected changes in traffic flows, or anomalous connections.

The Benefits of an Intrusion Detection System

The prevalence of cyberattacks in recent years has made it essential for businesses and organizations to invest in a comprehensive cybersecurity strategy. One of the most important components of such a strategy is an Intrusion Detection System (IDS). An IDS is a system that is designed to detect malicious activity within a network in order to protect the system from harm. It can detect malicious activity in several ways, including packet filtering, port scanning, network mapping, and DOS attacks.

Packet filtering is the process of examining incoming and outgoing traffic to a network. Packet filtering operates on more than just TCP/IP headers, and is used to detect malicious or suspicious packets that may contain malicious content or may be part of a larger attack.

Learn more about the tcp/ip protocole :

https://brainly.com/question/27744209

#SPJ4

Consider a datagram network using 32-bit host addresses. Suppose a router has four links,
numbered 0 through 3, and packets are to be forwarded to the link interfaces as follows:
Destination Address Range Link Interface
10100101 00000000 00000000 00000000
through
11100000 00111111 11111111 11111111
0
10100101 01000000 00000000 00000000 1
through
10100101 01000000 11111111 11111111
10100101 01000001 00000000 00000000
through
10100101 01111111 11111111 11111111
2
10100101 01000001 00000000 00001000
through
10100101 01000001 00000000 00001111
1
10100101 01000001 00110000 00000000
through
10100101 01000001 00110001 11111111
0
Otherwise 3
a. Convert this table to a forwarding table with symbols “*” so that the longest prefix
matching can be applied to forward packets to the correct link interfaces. One
example can be found on P23 of 04-CSCI 525-Network Layer.pdf
b. Describe how your forwarding table determines the appropriate link interface
for datagrams with destination addresses:
I. 10100101 10010001 01010001 01010101
II. 10100101 01000001 00110001 11111011
III. 11100001 01000000 11000011 00111100
IV. 10100101 01000001 00110000 01110111
V. 10100101 11000001 00110001 11111111
VI. 10100101 01000001 00000000 00001010
VII. 11001000 00010111 00010110 10100001
VIII. 10100101 01000001 00110001 11001111
IX. 10100101 01000011 00110000 00011100

Answers

SOLUTION :

a. Forwarding Table

Destination Address Range Link Interface

**************************************** 0

10100101 00000000 00000000 00000000

through

11100000 00111111 11111111 11111111

10100101 01000000 00000000 00000000 1

through

10100101 01000000 11111111 11111111

* ******* ********** ********** ****** 2

* ******* ********** 00001000 11111111 1

* ******* ********** 00110000 00000000 0

* ******* ********** 00110001 11111111 0

Otherwise 3

b.

I. Link Interface 3

II. Link Interface 0

III. Link Interface 3

IV. Link Interface 0

V. Link Interface 0

VI. Link Interface 1

VII. Link Interface 3

VIII. Link Interface 0

IX. Link Interface 0

What is interface ?

Interface: What is it?

A class's blueprint is what a Java interface is. Both static variables and abstract methods are included. In Java, abstraction is accomplished using the interfaces. In the Java interface, only abstract operations are permitted; method bodies are not permitted.

To know more about interface
https://brainly.com/question/23115596
#SPJ1

Which option would complete the statement?

for row in range(0,3):
line = "";
for col in range(0,5):
line += "*";
print(line);

A. outer loop
B. inner loop
C. while loop
D. Reverse loop (not real im pretty sure)

Answers

Answer:

A. outer loop

Explanation:

in this case, the outer loop is the for loop that is executed first, then the inner loop is executed. the outer loop is the one that is repeated 3 times, and the inner loop is the one that is repeated 5 times

the output should look like this

*

**

***

****

*****

*

**

***

****

*****

*

**

***

****

*****

1.Cassandra just left her doctor’s office with a referral to a dietician and an appointment with a radiology technician. Describe a scenario in which Cassandra would work with both a radiology technician and a dietician.

2.The Health Science and Law, Public Safety, Corrections, and Security clusters both feature careers that seek to help people thrive. In your own words, explain what makes these clusters different.

3.You might have noticed that many careers require the common skills of empathy and critical thinking/problem solving. When you’re dealing with people, and their health and safety, these skills are often required! Choose a career you find interesting from the clusters in the Unit. Explain, using a scenario, why EITHER empathy or critical thinking skills would be important in that job.

4. Vlad wants a career that will offer him a great wage. He realizes the university administrator career might be a good fit for him. Why is the average salary for a university administrator much higher than most of the other salaries covered in the lessons?
5. Why are foreign service officers part of the Government and Public Administration career cluster rather than the Law, Public Safety, Corrections, and Security cluster?

Answers

Cassandra is likely seeing the radiology technician and dietician for a weight-loss plan.

What is technician?

A technician is a professional who has specialized knowledge in a specific area, such as computers, electronics, engineering, mechanics, and other technical fields. Technicians are often responsible for troubleshooting, installing, repairing and maintaining equipment, as well as providing technical support and advice to customers.

They typically have a wide range of skills and knowledge and may specialize in a certain type of equipment. Additionally, technicians may be required to develop and test new equipment, or to manage a team of other technicians.

1. Cassandra is likely seeing the radiology technician and dietician for a weight-loss plan. The radiology technician will likely take images of her body to give her an idea of where she is starting from and to provide a baseline for tracking her progress. The dietician will help her create a meal plan and discuss how to make healthy choices that will support her goals.

2. The Health Science and Law, Public Safety, Corrections, and Security clusters are both focused on helping people, but the Health Science cluster focuses on providing medical care and promoting health, while the Law, Public Safety, Corrections, and Security cluster is focused on protecting people and maintaining justice and order.

3. Let's say Vlad is interested in being a police officer. In this job, empathy is important in order to build relationships with the community and to understand how to best help people. At the same time, critical thinking skills are essential in order to make quick decisions and assess the situation in order to keep everyone safe.

4. University administrators are responsible for managing the day-to-day operations of a university, such as budgeting, fundraising, and managing staff. Because of the level of responsibility and the importance of the job, university administrators tend to make a higher salary than most other careers.

5. Foreign service officers are part of the Government and Public Administration cluster because they are responsible for representing their country in foreign nations. This includes managing economic, cultural, and diplomatic relations with other countries, which are all tasks that are part of the duties of a government official.

To learn more about technician
https://brainly.com/question/18428188
#SPJ1

A 600mm lens will have a field of view of approximately
O 46°
O 600°
O 100⁰
O 4º

Answers

Answer:

I will go for 4°

Explanation:

i hope this helps

Answer: 4º

Explanation: A 600mm lens will have a field of view of approximately 4°. The field of view of a lens is determined by the focal length of the lens and the size of the film or image sensor. A longer focal length lens will have a narrower field of view, while a shorter focal length lens will have a wider field of view. 600mm is a very long focal length, so the field of view will be correspondingly narrow.

the method find the largest should return the largest of any number of double values. for example, the call find largest (3.4, -2.6, 2.9). t/f

Answers

Integers on average... If a=1.3, create a program that finds the greatest possible number using a while loop. The task is done by a double for loop.

How can I determine the two greatest numbers in an array?

Start two variables with a value of zero. Run a comparison between each integer in the array's elements after iterating through the array's elements. MaxOne = number and maxTwo = maxOne if current number is more than maxOne.

How do you arrive at the biggest number?

The maximum possible number doesn't exist. No matter how many there are, there will always be more. (For instance, to make a greater number, you could always add 1).

To know more about double visit:-

https://brainly.com/question/23083586

#SPJ4

Is there a way to make folders i put on my desktop from a flash drive automatically save to the 1 TB D drive and not the 118 GB C drive in Windows 10 pro? Thank you.

Answers

Yes,  there a way to make folders i put on my desktop from a flash drive automatically save to the 1 TB D drive and not the 118 GB C drive in Windows 10 pro.

What is the right way to handle the issue above?

It is very possible to set up a folder on your desktop to automatically save to a different drive, such as your D drive, in Windows 10 Pro. Here are ways that you can do this:

Connect your flash drive to your computer.Navigate to the folder on the flash drive that you want to access from your desktop.Right-click on the folder and select "Create shortcut."A shortcut to the folder will be created on your desktop.Right-click on the shortcut and select "Properties."In the "Properties" window, click on the "Location" tab.In the "Location" field, type the path to the location where you want the folder to be saved on your D drive. For example: "D:\My Folder".Click "Apply" to save the changes.

Thereafter, any files that you save to the folder on your desktop will be automatically saved to the location on your D drive that you specified. Note that this will not move the original folder on your flash drive; it will only create a shortcut on your desktop that points to the folder on the D drive.

Learn more about flash drive from

https://brainly.com/question/27800037
#SPJ1

Dot-com domain name registration is carried out on an auction basis to ensure the highest bidder gains rights to the desired domain name.a. Trueb. False

Answers

The correct answer is A. False

How are Dot com domains acquired?

Dot-com domain names are not typically auctioned off to the highest bidder. Instead, they are generally registered on a first-come, first-served basis through domain name registrars, which are organizations accredited by the Internet Corporation for Assigned Names and Numbers (ICANN) to sell domain names.

There are exceptions to this, such as when a domain name is subject to a dispute or when multiple parties attempt to register the same domain name simultaneously, in which case it may be resolved through an auction or other means. However, in general, dot-com domain names are not auctioned.

To Know More About Dot-com, Check Out

https://brainly.com/question/8002452

#SPJ1

there is a problem with nvidia geforce gtx 1660 super device. for more information, search for 'graphics device driver error code 43'

Answers

If your GPU has a driver issue, the error code 43 is usually displayed. This error can sometimes be caused by a hardware issue on your computer.

What is Error Code 43 in Graphics Card?

Error code 43 indicates that your GPU is malfunctioning. The following are the most common causes of this problem:

This error could occur if your GPU is not properly connected. This issue can also be caused by a faulty graphics card. If this occurs, your PC will not recognize.Sometimes the most recent drivers do not work well with your GPU. Reinstalling drivers with Display Driver Uninstaller may help to resolve the issue.

To know more about Display Driver : https://brainly.com/question/29454255

#SPJ4

Describe the basic function of systems management tools. If you were starting a new company, do you feel like these tools would be a valuable investment? Explain your answer

Answers

Systems are created to connect various departments and components of an organization so they can cooperate to accomplish corporate goals.

What is system?

System is defined as a grouping of components or pieces that are arranged for a single function. A computer system is an integrated set of devices that can input, output, process, and store data and information. At least one digital processor is used in modern computer systems.

A management information system makes data more accessible, which lowers uncertainty and enables managers to base their judgments on insightful facts to provide improved ratio quality. The administration of a corporate network's or data center's information technology (IT) systems is known as systems management.

Thus, systems are created to connect various departments and components of an organization so they can cooperate to accomplish corporate goals.

To learn more about system, refer to the link below:

https://brainly.com/question/19368267

#SPJ1

an intruder transmitting packets from the outside with a source ip address field containing an address of an internal host is known as ip address .

Answers

An intruder transmitting packets from the outside with a source ip address field containing an address of an internal host is known as ip address SPOOFING.

The Dangers of IP Address Spoofing

IP address spoofing is a malicious practice that puts computer networks and users at risk. It occurs when an intruder transmits packets from the outside with a source IP address field containing an address of an internal host. This technique is used to gain unauthorized access to a network, hide the true identity of the sender, and even launch a denial-of-service attack. As a result, it is important to understand what IP address spoofing is, how it works, and the security measures that can be taken to protect oneself from it.

First, it is important to understand what IP spoofing is and how it works. IP spoofing is essentially a type of network attack where the attacker modifies the source address of an IP packet to make it appear as though the packet originated from a different source. This is done by changing the origin of the packet to the internal address of another user on the network, allowing the attacker to gain access to the network and perform malicious activities. The intruder can then use this access to steal information, launch a denial of service attack, or even gain control of the network.

Learn more about IP address :

https://brainly.com/question/6275126

#SPJ4

import random
def loadWordList(path):
lines=[]
try:
fileObj = open (path,"r")
for line in fileObj:
lines.append(line)
except:
print(f"Error with file: {path}")
return None
return lines
def guessWord(mWord):
asteriskWord = "*" * (len(mWord) - 1)
# convert each character in asteriskWord to a list
asteriskList = list(asteriskWord)

# repeat until all * have been converted to their matching letter
while ("*" in asteriskWord):
letterFound = False
print("\n\n")
print (asteriskWord)
letter = input("Enter a letter to guess --> ")
letter = letter[0]
for i in range(len(asteriskList)+1):
if letter == mWord[i]:
asteriskList[i] = letter
letterFound = True
if not letterFound:
print (f"{letter} is not in the mystery word")
# convert list back to a string
asteriskWord = "".join(asteriskList)
print(f"\n\nCongradulations: you guessed the word {mWord}")
def main():
wordList = loadWordList("c:\\user\\sandy\\wordlist.txt")
mysteryWord = wordList[random.randrange(0,len(wordList))]
guessWord(mysteryWord)
main()

I need to fix the bugs and also add the word "bomb" to the code as a mystery word

Answers

Using the knowledge in computational language in python it is possible to write a code that using a string that debug a code of the game.

Writting the code:

def loadWordList(path):

lines=[]

try:

fileObj = open (path,"r")

for line in fileObj:

lines.append(line)

except:

print(f"Error with file: {path}")

return None

return lines

def guessWord(mWord):

asteriskWord = "*" * (len(mWord) - 1)

while ("*" in asteriskWord):

letterFound = False

print("\n\n")

print (asteriskWord)

letter = input("Enter a letter to guess --> ")

letter = letter[0]

for i in range(len(asteriskList)+1):

if letter == mWord[i]:

asteriskList[i] = letter

letterFound = True

if not letterFound:

print (f"{letter} is not in the mystery word")

asteriskWord = "".join(asteriskList)

print(")

def main():

wordList = loadWordList("c")

mysteryWord = wordList[random.randrange(0,len(wordList))]

guessWord(mysteryWord)

main()

See more about python at brainly.com/question/18502436

#SPJ1

Given two date 01/12/2022 and 02/11/2022 compare the two using if else statement to prove that 01/12/2022 is grater than 02/11/2022

Answers

Answer:

date1 = "01/12/2022"

date2 = "02/11/2022"

if date1[3:5] > date2[3:5]:

   print(date1, "is greater than", date2)

else:

   print(date2, "is greater than", date1)

In mandatory access control (MAC), access rules are closely managed by the security administrator and not by the system owner or ordinary users for their own files. A. TrueB. False

Answers

Mandatory access control (MAC) is a type of access control where the policy administrator, not the user, can allow or limit access to particular files.

What Is Access Control?Users frequently come across resources and assets that they should not have access to as they move through physical and digital networks. This is especially true for digital systems, because lateral migration to other storage, application, or processing locations can result in risky security concerns that jeopardize the system's overall infrastructure.Security administrators employ "access controls" that restrict who can access certain resources in order to ensure the separation of assets and resources.In essence, an access control system establishes restrictions on who, when, where, and occasionally how a user can use a system after that user has been validated and granted access via a user account or identity.

To Learn more About Mandatory access control refer to:

https://brainly.com/question/14205543

#SPJ4

When using category cable, what type is recommended?

A) Any CAT5 Cable. They are industry standard.
B) CAT5e or better is recommended.
C) Only Dante-Certified cable should be used.

Answers

Cat 6 and Cat 6a cables are a wonderful option if you want to ensure that you obtain the best speeds.They are frequently not much more expensive than Cat 5 and a smart choice for future-proofing.

What kind of cable is advised when utilizing Category cable? Cat 6 and Cat 6a cables are a wonderful option if you want to ensure that you obtain the best speeds.They are frequently not much more expensive than Cat 5 and a smart choice for future-proofing.It's better not to utilize Cat 5 because it's been superseded.Computer networks like Ethernet over Twisted Pair utilize structured cabling, which uses category 5 wire.The cable standard is appropriate for 10BASE-T, 100BASE-TX (Fast Ethernet), 1000BASE-T (Gigabit Ethernet), and 2.5GBASE-T, and it sets performance parameters for frequencies up to 100 MHz.Cat 5 is the most fundamental type of Ethernet cable.It's difficult to find and extremely antiquated cable.

To learn more about Category cable refer

https://brainly.com/question/28122297

#SPJ1

explain how the thermostat supports the peripherals used in the project. make sure that you have included all the required details from the scenario in your report. you should discuss each of the three outlined hardware architectures, including ti, microchip, and freescale.

Answers

The project's peripherals are backed by the thermostat, which gives the system the required power and control logic.

About thermostat

The MSP430 microcontroller in the TI architecture handles the thermostat's heat detection, displays, and control operations. The MSP430 communicates with peripherals like the temperature sensor and display and supplies the system with the appropriate control logic. Through its voltage regulator and a battery management system, it also powers the system. The PIC16F microcontroller from Microchip serves as the system's controller in the architecture. The temperature sensor, monitor, and other peripherals are all connected up through it as well. Throughout its voltage regulator & battery management system, it also powers the system.

To know more about thermostat
https://brainly.com/question/22598217
#SPJ4

Assume you have written a method with the header num yourMethod(string name, num code). The method's type is ____ .

Answers

A method is written with the header 'num' yourMethod(string name, num code). The method's type is 'num'.

In the context of programming. a header refers to supplemental data placed at the beginning of a block of data being transmitted or stored. In the context of the Java method, the header is where you tell the Java program what value type if any, the method will return (a string value, an int value, a double value,  etc). As well as the return type, you require a name for your method, which is also placed in the header. You can pass values over to your methods in between a pair of round brackets.

You can learn more about method in Java at

https://brainly.com/question/28489761

#SPJ4

In a batch machining operation, setup time is 1.5 hr and batch size is 80 units. The cycle
time consists of part handling time of 30 sec and processing time of 1.37 min. One part
is produced each cycle. Tool changes must be performed every 10 parts and this takes
2.0 min. Determine (a) average cycle time, (b) time to complete the batch, and (c) average
production rate.

Answers

a. The average cycle time is 192.5 seconds.

b. The time to complete the batch is 15400 seconds.

c. The average production rate is 19 seconds.

How to calculate the production rate?

Set up time = 1.5 hours

Batch size = 80 units ,

Cycle time = 30 seconds =30 sec * 80 jobs = 2400 sec

Now, calculating, Process time will be:

= 1.37 min = 83 sec * 80 jobs

= 6640 sec

Tool change = 2 mins is for 10 parts = 16 min for 80 parts

= 960 sec

Set up time + cycle time + process time + Tool changing time

= 5400 + 2400 + 6640 +960

= 15400 sec

Average cycle time = 15400 /8

= 192.5 sec

Total time for 80 parts:

= 5400 + 2400 + 6640 +960

= 15400 seconds

Average production rate:

= 3600 / 192.5

= 18.70

= 19

Learn more about production on:

https://brainly.com/question/16755022

#SPJ1

Q 1: Write a function to measure the amortized cost of appending for Python’s list class.

Q 2: Write functions for two primary operations in the Queue enqueue ( ) and dequeue ( ).

Answers

Answer:

Q 1:

import time

def measure_amortized_cost_of_appending(num_iterations):

 # Create an empty list

 lst = []

 # Start a timer

 start_time = time.perf_counter()

 # Append num_iterations elements to the list

 for i in range(num_iterations):

   lst.append(i)

 # End the timer

 end_time = time.perf_counter()

 # Calculate and return the amortized cost of appending

 return (end_time - start_time) / num_iterations

This function creates an empty list, starts a timer, appends num_iterations elements to the list, and ends the timer. It then calculates and returns the amortized cost of appending by dividing the elapsed time by the number of iterations.

Q 2:

class Queue:

 def __init__(self):

   self.items = []

 def enqueue(self, item):

   self.items.append(item)

 def dequeue(self):

   return self.items.pop(0)

This implementation of the Queue class uses a Python list to store the items in the queue. The enqueue method appends an item to the end of the list, and the dequeue method removes and returns the item at the front of the list (index 0).

Other Questions
A 0. 2121-g sample of an organic compound was burned in a stream of oxygen, and the co2 produced was collected in a solution of barium hydroxide. Calculate the percentage of carbon in the sample if 0. 6006 g of baco3 was formed. How could you identify if a substance is an element ? Can someone help, please If you are creating an artificial cell and you want this cell to be capable of the greatest sensitivity to an applied signal, which would be the most useful?. I dont feel like typing 1. In what ways was the world different in the early 1800 s than it is now? 2. What would your life be like if you lived during that time period? 3. What different points of view are represented in the three texts above? 4. Who was happy about westward expansion? Who was not? question is in the screenshot which of the following is generally more important than the specific technique a therapist uses in determining the success of psychotherapy? bill, the hr manager at esposito inc., compiles the company newsletter and in the process coordinates with the managers of other departments. the communication seen in this scenario best exemplifies communication. a.horizontal b.upward c.vertical d.informal e.diagonal A 70 kg mountain climber dangling in a crevasse stretches a 50-m-long, 1.0-cm-diameter rope by 8.0 cm. Part A What is Young's modulus for the rope? Express your answer with the appropriate units. HAO ? Value Units Please name these last two shapes What are some things humans can do to slow down their impact on the environment? In the following function prototype, how many parameter variables does this function have?int myFunction(double, double, double);a. 1b. 2c. 3d. cannot tell from the prototype Mitchell and Emma are senior students that share a biology class. Their high school has a section on school property that has been used to grow various plants over the years. Each student is required to select a plant to study for their final project. The pictures show some of the plants that are grown on school property. The tulips, irises, and daffodils reproduce asexually. The snapdragons and the roses reproduce sexually.Mitchell is interested in the snapdragons that reproduce sexually. He knows that purple (P) is dominant to white (w). Mitchell crosses a homozygous purple plant with a homozygous white plant. If he breeds two of the first generation offspring together, what percentage of the second generation offspring can Mitchell predict will most likely be white? a. 25% b. 50% c. 75% d. 100% In 1992, there were 285 alligators in Orange County, Florida. The number of alligators increased by 75% per year after 1992. How many alligators were there in Orange County, Florida in 2001? ecrire ta lettre pour le pere noelrepede va rog!!! Solve 15x - 10y = -30 and 5x - 9y = 7 using elimination. Show Steps. Put answer in coordination form (x,y) A ramp goes from a doorway of a building to the ground. The end of the ramp connected to the doorway is 1 foot above the ground. The horizontal distance from the bottom of the ramp to the building is 10 feet. What is the angle of elevation of the ramp to the nearest degree? Cara wants to build an 80 foot long rectangular sheep pen in back of her barn. If she bought 180 feet of fencing and used her barn wall as one side of the pen equaling the width, what would be the area of the sheep pen?. (1). 7/10 - 2/5(2). 3/4 + 5/6(3). 17/9 - 11/12(4). 2/3 + 1/4 - 7/12