I don't know the answer
C program
You are to write a program which will do the Lotto.
The lotto consists of 5 numbers from 1-70 and a power ball from numbers 1-30.
The first 5 numbers should not repeat (same for the winning numbers). The power ball can repeat with any of the first 5 numbers.
You are going to purchase 10,000 lotto tickets. Each ticket has 6 numbers (5 num and 1 pow).
Give each ticket random numbers, and compare to the winning numbers (winning numbers generated only once).
Match the 5 numbers and the power ball number and you win the jackpot!
Match 5 numbers only and you win $1,000,000.
Match 4 numbers only and you win $50,000.
Match 3 numbers only and you win $7.
Match under 3 numbers, but you got the power ball and you win $4.
anything else wins nothing.
Need help, program must work!!!
Code :
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUM_TICKETS 10000
#define NUM_NUMBERS 5
#define MAX_NUMBER 70
#define MAX_POWERBALL 30
void generateNumbers(int arr[], int n, int max) {
int i, j, temp;
for (i = 0; i < n; i++) {
arr[i] = rand() % max + 1;
for (j = 0; j < i; j++) {
if (arr[j] == arr[i]) {
i--;
break;
}
}
}
}
void printNumbers(int arr[], int n) {
int i;
for (i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
}
int checkMatch(int ticket[], int winningNumbers[], int powerball) {
int i, numMatch = 0;
for (i = 0; i < NUM_NUMBERS; i++) {
if (ticket[i] == powerball) {
numMatch++;
break;
}
}
for (i = 0; i < NUM_NUMBERS; i++) {
int j;
for (j = 0; j < NUM_NUMBERS; j++) {
if (ticket[i] == winningNumbers[j]) {
numMatch++;
break;
}
}
}
return numMatch;
}
int main() {
int i, j;
int winningNumbers[NUM_NUMBERS];
int winningPowerball;
int ticket[NUM_NUMBERS + 1];
int jackpot = 0, match5 = 0, match4 = 0, match3 = 0, matchPowerball = 0;
srand(time(NULL));
generateNumbers(winningNumbers, NUM_NUMBERS, MAX_NUMBER);
winningPowerball = rand() % MAX_POWERBALL + 1;
printf("Winning numbers: ");
printNumbers(winningNumbers, NUM_NUMBERS);
printf("Powerball: %d\n", winningPowerball);
for (i = 0; i < NUM_TICKETS; i++) {
generateNumbers(ticket, NUM_NUMBERS, MAX_NUMBER);
ticket[NUM_NUMBERS] = rand() % MAX_POWERBALL + 1;
int numMatch = checkMatch(ticket, winningNumbers, winningPowerball);
switch (numMatch) {
case 6:
jackpot++;
break;
case 5:
match5++;
break;
case 4:
match4++;
break;
case 3:
match3++;
break;
case 1:
if (ticket[NUM_NUMBERS] == winningPowerball) {
matchPowerball++;
}
break;
}
}
printf("Jackpot winners: %d\n", jackpot);
printf("Match 5 winners: %d\n", match5);
printf("Match 4 winners: %d\n", match4);
printf("Match 3 winners: %d\n", match3);
printf("Match powerball winners: %d\n", matchPowerball);
return 0;
}
EXPLANATION:This program generates the winning numbers and powerball using the generateNumbers() function, which ensures that each number is unique. It then generates 10,000 lotto tickets and checks each one using the checkMatch() function, which returns the number of matching numbers and the powerball. The results are tallied and printed at the endWhen the function below is called with 1 dependent and $400 as grossPay, what value is returned?
double computeWithholding (int dependents, double grossPay)
{
double withheldAmount;
if (dependents > 2)
withheldAmount = 0.15;
else if (dependents == 2)
withheldAmount = 0.18;
else if (dependnets == 1)
withheldAmount = 0.2;
else // no dependents
withheldAmount = 0.28;
withheldAmount = grossPay * withheldAmount;
return (withheldAmount);
}
a. 60.0
b. 80.0
c. 720.0
d. None of these
Answer:
b. 80.0
Explanation:
Given
\(dependent = 1\)
\(grossPay = \$400\)
Required
Determine the returned value
The following condition is true for: dependent = 1
else if (dependnets == 1)
withheldAmount = 0.2;
The returned value is calculated as:
\(withheldAmount = grossPay * withheldAmount;\)
This gives:
\(withheldAmount = 400 * 0.2\)
\(withheldAmount = 80.0\)
Hence, the returned value is 80.0
6. After you've searched for flowers with fewer than 100 in stock, you realize you also want to know
which of these flowers are used in the pre-made arrangements. Use multiple parameters to search for
these results. Generate a report showing all the flowers with fewer than 100 in stock that are also
used in the pre-made arrangements.
To generate the report, you have to do the following:
Retrieve the data for flowers with fewer than 100 in stockRetrieve the data for flowers used in pre-made arrangementsCompare the two sets of dataGenerate the reportHow to generate the reportRetrieve the data for flowers with fewer than 100 in stock:
Iterate through your flower data and filter out the flowers with a stock quantity less than 100.
Retrieve the data for flowers used in pre-made arrangements:
Iterate through your pre-made arrangement data and extract the flowers used in each arrangement.
Compare the two sets of data:
Iterate through the filtered flower data from step 1 and check if each flower is present in the pre-made arrangement data from step 2.
Generate the report:
For each flower that meets the criteria (fewer than 100 in stock and used in pre-made arrangements), output the relevant information in a report format.
Read more on generated reports here:https://brainly.com/question/20595262
#SPJ1
survey and describe the system
Survey systems help create, distribute, and analyze surveys by providing a framework for designing questionnaires, managing respondents, and analyzing data.
What is survey?A survey system lets users create surveys with different question types and response options. The system offers multiple ways to distribute surveys, including sharing a web link, email invites, website embedding, and social media.
Data is collected from respondents and stored accurately and securely, with error checking and validation in place. After survey completion, analyze data with summary stats, visualizations, filters, and cross-tabulations for identifying patterns. Survey systems have reporting features to generate detailed reports based on its data, including statistics, graphs, etc.
Learn more about survey from
https://brainly.com/question/14610641
#SPJ1
somebody pls help!!! i don’t know what i did but i don’t know how to fix it
Answer:
Try refreshing, it doesn't look like you did anything wrong. Refreshing usually fixes it, or close the tab and reopen it. That should fix it.
Explanation:
100 points aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Answer:
An algorithm enables the programmer to perform a task or mission. So the answer is A. A loop is repeating while a website requires loops and algorithms
Answer:
answer is loop
an excel data source must include ___
A) row labels in the first column
B) column labels in the first row
C) column labels in any row
D) row labels in any column
Answer:
Option (B)
Explanation:
To use Excel files as a data source, you must ensure that the worksheet data is in list format. This means that the data must be set up in a database format consisting of one or more named columns. The first row in each column must have a label, and there can be no blank columns or rows within the list.
Answer:B must have
Explanation:
PLEASE HELP
7.6 LAB: Replacement words Write a program that finds word differences between two sentences. The input begins with the first sentence and the following input line is the second sentence. Assume that the two sentences have the same number of words. The program displays word pairs that differ between the two sentences. One pair is displayed per line.
Ex: If the input is:
Smaller cars get better gas mileage Tiny cars get great fuel economy
then the output is:
Smaller Tiny better great gas fuel mileage economy
Hint: Store each input line into a list of strings.
This assignment is required to be executed in python programming language. See the code below.
What is the code that displays word pairs that differ between the two sentences?# taking two sentence as input s1 = input() s2 = input()
# getting the words in both sentences in list w1 = s1.split() w2 = s2.split() # looping through the word lists and checking if they are equal or not for i in range(len(w1)):
# printing word pairs if they are not equal
if (w1[i] != w2[i]):
print(w1[i],w2[i])
Learn more about python programming language at;
https://brainly.com/question/26497128
#SPJ1
You are a sports writer and are writing about the world legend mushball tournament. And you are doing an article on the 2 wildcard teams the 2 teams with the best record who are not. Division? Leaders according to. The table shown which two teams are the wild card teams?
The two teams are not division leaders, but their records are impressive enough to get them to participate in the tournament. The teams' records are as follows: Team C with 8-3 record and Team D with a 7-4 record. These teams are the second-best teams in their respective divisions, and that is what gets them a spot in the tournament.
The table presented depicts a ranking of teams for a particular tournament. Wildcard teams are teams that do not lead their divisions but have the best records; they get to participate in the tournament. In this case, we will determine the two wildcard teams and their records based on the table.
The wild card teams in the world legend mushball tournament are Team C and Team D.Team C and Team D are the two wildcard teams in the tournament. They are selected based on their record, as shown in the table. Wildcard teams are often determined by the records of the teams.
The two teams are not division leaders, but their records are impressive enough to get them to participate in the tournament. The teams' records are as follows: Team C with 8-3 record and Team D with a 7-4 record. These teams are the second-best teams in their respective divisions, and that is what gets them a spot in the tournament.
The wildcard teams offer a chance to other teams that may not have made the playoffs a chance to show their skills. The top team in each division automatically qualifies for the playoffs, and the other spots go to the wild card teams. Wild card teams are often the teams that show resilience and a fighting spirit; they do not give up easily and always give their best.
For more such questions on tournament, click on:
https://brainly.com/question/28550772
#SPJ8
If you can answer theses ill give u a brainliest (i think thats how u spell it) but only if u get it right u will get one NOT A SCAM!!
Question: In which logical operator at least one condition has to be true?
O or
O None of the above
O not
O and
Question: In which logical operator both conditions must be true?
O and
O or
O not
O None of the above
Answer:
or / and
Explanation:
i took the quiz at unitek college
Answer:
1. or
2. and
Explanation:
How do I change the default interactive shell as zsh on a Mac?
Zsh (short for Z Shell) is a Unix shell and command-line interpreter that is designed to be an interactive login shell and command-line interface. It is an alternative to the more common Bash shell that is used by default on many Unix-based systems, including macOS.
What is zsh in mac?
changing the default interactive-shell to zsh on your Mac, you need to repeat the given steps:
Install zsh: If you haven't installed zsh already, you can do so using Homebrew, a package manager for macOS.Now, Open the Terminal app and use the command given:brew install zsh
Verify the path to zsh: Once zsh is installed, you can verify the path to zsh by running the following command in Terminal:which zsh
Change the default shell: To change the default shell to zsh, you need to edit the /etc/shells file to include the path to the zsh binary. use command: sudo nano /etc/shellsAdd zsh to /etc/shells: In the nano text editor, add the path to the zsh binary to the end of the file, on a new line. For example, if the path to zsh is /usr/local/bin/zsh, you would add the following line to the end of the file:/usr/local/bin/zsh
Save and exit: Once you have added the path to zsh to /etc/shells, save the file by pressing Ctrl+O, then exit nano by pressing Ctrl+X.Change the default shell: To change the default shell to zsh, run the following command in Terminal:chsh -s /usr/local/bin/zsh
Replace /usr/local/bin/zsh with the path to the zsh binary that
you obtained in step 2.
Log out and log back in: Finally, log out of your macOS user account and log back in to apply the changes. You should now have zsh as your default interactive shell.To know more about zsh shell, visit: https://brainly.com/question/30528402
#SPJ4
Assume your organization has several database servers. What are three controls that would protect the servers
If your organization has several database servers. The three controls that would protect the servers are
Set up and Use a SSH (Secure Shell) Protocol.Always Use SSH Keys Authentication.Do use Private Networks and VPNs.What is a server?This is known to be a computer or system that helps to give resources, data, services, or programs to different kinds of computers, which are said to be called clients over a network.
It is very important that , whenever computers share resources with client, that they should be secured and as such it is better to Set up and Use a SSH (Secure Shell) Protocol in server setting.
Learn more about servers from
https://brainly.com/question/25554117
Javier wants to copy the last four digits of ID numbers from cell A2. Order the steps for the formula.
4)
RIGHT
(A2
Intro
Answer:=, RIGHT, (A2 (,) 4)
Explanation:
Yes
Answer:
=
Right
(A2
,
4)
Explanation: I got it right
helppppppppppppppp me please Can i have help for a ggogle class room
no links some one have a code or som for i can make Can i have help for a ggogle class room
Answer:
ask your teacher for the class code and when she gives it to you, use your moe email address and add press join class and enter the code.
What is the relationship model in this ER digram?
Answer:
ER (ENTITY RELATIONSHIP)
Explanation:
An ER diagram is the type of flowchart that illustrates how "entities" such a person, object or concepts relate to each other within a system
Pls due soon
Directions: Answer these questions as you navigate through the modules of the Computer Basics Tutorial.
Define computer:
What are the functions of a computer?
Name three ways in which you can use a computer?
Define hardware:
Define software:
Name at least four different types of computers.
What are the two main styles that personal computers come in?
What is the purpose of the operating system?
Name the three most common operating systems for PCs.
What does GUI stand for and what is its purpose?
In what year did Microsoft create Windows?
What is MAC OS?
What is Linux?
Name three operating systems designed specifically for mobile devices?
What is an App?
What are apps for mobile devices called?
Name six types of desktop applications?
Name three examples of mobile apps (does not have to come from the tutorial)?
What is the Cloud?
Name three services that use the Cloud?
Give at least one reason why someone would want to use the Cloud.
Give three examples of web apps?
What are the basic parts of a desktop computer and what purpose does each one serve?
Name two common mouse alternatives?
Name at least five peripherals?
What is the CPU/Processor of a computer?
How is the processor’s speed measured?
What is the motherboard and what purpose does it serve?
What does the power supply unit do?
What is RAM and what is it measured in?
What is a hard drive and what purpose does it serve?
What is the purpose of each of the following:
expansion card
video card
sound card
network card
Bluetooth card
What is a laptop computer and how is it different from a desktop computer?
What is a mobile device? Give three examples.
What is a smartphone?
What are 3G, 4G, and LTEs?
How is a tablet computer different from a laptop? What are some advantages and disadvantages of using a tablet?
What is the desktop and what features does it usually contain?
What is the purpose of using folders on the computer?
What is the purpose of the Recycle Bin?
Name three things you need to access the Internet?
Describe each of the following common types of Inter services:
Dial-up
DSL
Cable
Satellite
3G and 4G
What are some things you should consider when you are choosing and Internet Service Provider?
What is a modem?
What is a router?
What is a network card?
What does Wi-Fi stand for?
What is a web browser and what is its main job?
What is the World Wide Web?
Name three different types of web browsers?
Explain the following security terms:
SSID:
Encryption password
Encryption
Passphrase
What steps do you need to take to keep your computer healthy?
How do you deal with spilled liquid on your keyboard?
How do you clean the mouse and the monitor?
What is malware and what does it include? What is the best way to guard against malware?
In what ways can you back up your computer?
Name several techniques to maintain your computer?
Define computer ergonomics.
What are four general tips to keep in mind when troubleshooting your computer?
What is a flash drive?
What is Cloud storage?
What is the proper way to safely remove a flash drive from the computer?
Name three free popular services that allow you to save data to the Cloud?
What are accessibility features? Name three?
Name three assistive technology devices and what they are used for?
Answer:
Software for personal computers is typically developed and distributed independently from the hardware or operating system manufacturers. Many personal computer users no longer need to write their own programs to make any use of a personal computer, although end-user programming is still feasible. This contrasts with mobile systems, where software is often only available through a manufacturer-supported channel. And end-user program development may be discouraged by lack of support by the manufacturer.
Explanation:
_____ are assigned by the network administrator and enable users to access network resources.
A) NICs
B) Permissions
C) Fiber optics
D) MACs
Answer:
B) Permissions
list all the software apps on your cell phone write their uses and how it helps you as a student
1-5 please i need answers rn ASAP
Check out the image below. The text contained a link, so it is in jpeg format.
Brute force attacks involve identifying a valid user account and then bombarding the server with an extensive:
Answer:
List of possible passwords in search of the one password that will gain access to a system.
Explanation:
A brute force attack is a way of trying to gain illegal access into a password-protected website by using various combinations of passwords repetitively until you get the right one.
Programs and bots such as Crack, Hashcat, Rainbowcrack etc are used by hackers to perform brute force attack with the motive of stealing valuable data or taking over a website shutting it down.
Tools used in securing websites against such attacks work by denying a user or an IP address, after a limited number of wrong attempts. Such softwares include Deny and Fail2ban.
Which best explains why it is impossible to avoid inappropriate content online?
ОООО
Inappropriate content appears on all websites.
People are naturally inclined to seek inappropriate content.
Inappropriate content can be accessed accidentally.
Few tools exist to prevent access to inappropriate content.
Answer:
Few tools exist to prevent access to inappropriate content.
Explanation:
Answer:
option D is correct
Explanation:
I got it right
Barbarlee suspected and found a loophole in the university computer's security system that allowed her to access other students' records. She told the system administrator about the loophole, but continued to access others' records until the problem was corrected 2 weeks later. Was her actions unethical or not. Explain your position? What should be the suggested system administrators response to Barbarlee's actions? How should the university respond to this scenario?
Answer:
Explanation:
I can give you my opinion on the matter, not sure if this was taught to you or not so please take it with a grain of salt.
Her actions are highly unethical and even illegal to some extent. Especially in USA, FERPA prevents random people from accessing your educational records without your permission and there's hundreds of universities with their own rules/regulations on protecting students' privacy. The sys admin should have first recorded this event when she reported it and then actually went into the system to see if unwanted access has been done by any user(s). University should look at disciplinary actions since the person willingly accessed the system even after they reported the bug and also let ALL the university student/faculty/staff know of the problem and how they plan on fixing it.
This is only a summary, and this is my opinion. please expand in places where needed.
I found another answer in go.ogle:
I feel the actions of this person were unethical.
The student's action in searching for the loophole was neither definitively ethical nor unethical, as their motives are unclear.
The student's action in continuing to access records for two weeks was unethical, as this is a violation of privacy.
The system admin's failure to correct the problem could be considered unethical, but it is difficult to surmise, as there are not enough details.
establishing a more or less permanent relationship with peers is a sign of ellectual maturity true or false
pls answer quick omg
Answer:
False. Establishing a permanent relationship with peers is not necessarily a sign of intellectual maturity. Intellectual maturity encompasses various aspects such as critical thinking, problem-solving, and self-reflection, among others. It does not have a direct correlation with the ability to maintain relationships with peers.
Explanation:
ABOVE
[If you were the queen of the world .... What would you change ?]
Can anyone help me i want 5 slides powerpoint
Answer:
poverty and bad roads and help the needy
Question 2 (1 point) What should the main body paragraphs of a written document include?
identification of the subject
an outline
facts, statements, and examples a
summary of key points
The key concept or subject that will be covered in that specific paragraph should be introduced in the first sentence of that paragraph. Providing background information and highlighting a critical point can accomplish.
What information should a body paragraph contain?At a minimum, a good paragraph should include the following four components: Transition, main idea, precise supporting details, and a succinct conclusion (also known as a warrant)
What constitutes a primary body paragraph in an essay?The theme sentence (or "key sentence"), relevant supporting sentences, and the conclusion (or "transitional") sentence are the three main components of a strong body paragraph. This arrangement helps your paragraph stay on topic and provides a clear, concise flow of information.
To know more about information visit:-
https://brainly.com/question/15709585
#SPJ1
Use cin to read integers from input until 999 is read. For each remaining integer read before 999, if the integer is equal to 25, output "25 occurs" followed by a newline and increment numDetections.
Ex: If the input is 25 25 -6 25 25 999, then the output is:
25 occurs
25 occurs
25 occurs
25 occurs
4 time(s)
Ex: If the input is 25 25 -6 25 25 999, then the output is:4 time(s)
What is the code about?By using a while loop in this code, we can utilize the cin function to retrieve integers from input until the sentinel value 999 is reached. We verify the equality of every integer read with the value of 25.
Therefore, We issue the statement "25 is present" and increase the numDetections count if applicable. After completion of integer reading, we display the overall count of occurrences of the value 25. It should be noted that we utilize "endl" to add a line break character at the end of every line of output.
Learn more about code from
https://brainly.com/question/26134656
#SPJ1
Question # 4
Math Formula
What is the output of the following program?
for num in range(4):
print (num * 2)
The output will be:
0
2
4
6
This happens because the for loop iterates through the numbers in the range function and prints those numbers multiplied by two.
c program how to input this?
\(\huge \boxed{\sf code}\)
#include <stdio.h>
int main() {
// Declare the variables
float a,b,c,d,e;
float sum;
// Ask the user to input
printf("Enter the first number: ");
scanf("%f",&a);
printf("Enter the second number: ");
scanf("%f",&b);
printf("Enter the third number: ");
scanf("%f",&c);
printf("Enter the fourth number: ");
scanf("%f",&d);
printf("Enter the fifth number: ");
scanf("%f",&e);
// Use if statements to calculate the sum
if (a < 0) {
sum = sum + a;
}
if (b < 0) {
sum = sum + b;
}
if (c < 0) {
sum = sum + c;
}
if (d < 0) {
sum = sum + d;
}
if (e < 0) {
sum = sum + e;
}
// Print the sum
printf("Sum of all negative integers = %.2f\n", sum);
// Return an integer
return 0;
}
\(\Large \boxed{\sf explanation}\)
Declare the variables a, b, c, d, e, and sum as float type.
Display to the user to ask for input and take the input.
Use if statements to determine if a, b, c, d, and e are less than 0. If yes, then add them to the sum. If no, then skip to the following function.
Print the sum as a float type with 2 decimal points.
Return an integer.
Explain if a company is responsible for using computer components manufactured using fair trade practices. [9 marks]
Answer:
Fair trade practices aims at promoting the fair relationships between the buyers and producers. It is a kind of a social movement that makes the producers to provide the better conditions and humane working environment in case of developing countries.
• It also favors and supports the proper and substantial payment to the manufacturers and wages to the labors.
• It is a trading partnership that states the manufacturers to analyze and check their supply sources or resources and provide disclosure if the materials were produced or mined in the areas of conflict or areas of extreme poverty.
Explanation:
can you mark me as brainlist
Answer:
It is a trading partnership that states the manufacturers to analyze and check their supply sources or resources and provide disclosure if the materials were produced or mined in the areas of conflict or areas of extreme poverty.
Database systems are exposed to many attacks, including dictionary attack, show with implantation how dictionary attack is launched?(Java or Python) ?
A type of brute-force attack in which an intruder uses a "dictionary list" of common words and phrases used by businesses and individuals to attempt to crack password-protected databases.
What is a dictionary attack?
A Dictionary Attack is an attack vector used by an attacker to break into a password-protected system by using every word in a dictionary as a password for that system. This type of attack vector is a Brute Force Attack.
The dictionary can contain words from an English dictionary as well as a leaked list of commonly used passwords, which, when combined with common character replacement with numbers, can be very effective and fast at times.
To know more about the dictionary attack, visit: https://brainly.com/question/14313052
#SPJ1
Question 3 3.1 Describe the TWO main elements of a CPU 3.2 Describe the fetch/execute cycle 3.3 Convert the binary number 00000011 to a decimal
Answer:
Here are the answers to the questions:
3.1 The two main elements of a CPU are:
The Control Unit (CU): The CU controls and coordinates the operations of the CPU. It is responsible for interpreting instructions and sequencing them for execution.
The Arithmetic Logic Unit (ALU): The ALU executes arithmetic and logical operations like addition, subtraction, AND, OR, etc. It contains registers that hold operands and results.
3.2 The fetch/execute cycle refers to the cycle of events where the CPU fetches instructions from memory, decodes them, and then executes them. The steps in the cycle are:
Fetch: The next instruction is fetched from memory.
Decode: The instruction is decoded to determine what it is asking the CPU to do.
Execute: The CPU executes the instruction. This could involve accessing data, performing calculations, storing results, etc.
Go back to Fetch: The cycle continues as the next instruction is fetched.
3.3 The binary number 00000011 is equal to the decimal number 3.
Binary: 00000011
Decimal: 1 + 2 = 3
So the conversion of the binary number 00000011 to decimal is 3.
Explanation: