The election program illustrates the use of ArrayLists, loops and conditional statements.
ArrayLists are resizable arrays, while loops and conditional statements are used to perform repetitions and make decisions, respectively.
The election program written in Java, where comments are used to explain each line is as follows:
import java.util.*;
public class Main {
public static void main(String[] args) {
//This creates a Scanner object
Scanner input = new Scanner(System.in);
//This creates a string ArrayList for the names of the candidates
ArrayList<String> names = new ArrayList<String>();
//This creates an Integer ArrayList for the vote count of the candidates
ArrayList<Integer> votes = new ArrayList<Integer>();
//This declares name as string
String name;
//This gets input for the name of the candidates
name = input.nextLine();
//This is repeated until the user enters "-1"
while (!"-1".equals(name)){
//If name is in the list,
if(names.contains(name)){
//This gets the index of the name
int pos =names.indexOf(name);
//This calculates the number of votes
Integer value = votes.get(pos)+1;
//This adds the vote to the vote ArrayList
votes.set(pos, value);
}
//If otherwise
else{
//This adds the candidate name to the name ArrayList
names.add(name);
//This adds 1 as the vote of the candidate to the vote ArrayList
votes.add(1);
}
//This gets input for the name of another candidates
name = input.nextLine();
}
//This prints the name of the election winner
System.out.println("Winner : " +names.get(votes.indexOf(Collections.max(votes))));
}
}
Read more about ArrayLists, loops and conditional statements at:
https://brainly.com/question/19504703
Sort the layout options for two types of masters in PowerPoint.
Answer:
The program photo is showing the correct answers and the correct place for the two that you missed.
Explanation:
Answer: ANSWER IS SHOWN CORRECTLY
Explanation:
I REALLY HOPE IT HELPS YOU!!!!!!!!!!!!!
THANK YOU & BE SAFE TOO!!!!!!!!!!!!!!!
Michaela has been tracking the temperatures of the dirt, pond water, and air near her home for a science investigation. She is ready to analyze the data to prepare for her science report. Based on each application’s strengths and weaknesses, which one would be the best to choose for this task?
Answer:
The science of investigation
Explanation:
hope it help
Lori wants to set up a SOHO network in her apartment. The apartment comes with a Gigabit Ethernet network already installed. Lori's notebook computer has an integrated wireless network adapter. Her printer has an Ethernet card, but is not wireless enabled. Your task is to select the appropriate devices and cables (without spending more than necessary) to set up a network that provides wireless access for Lori's laptop and wired access for her printer.
Match the labels for the components on the left to the locations where they need to be installed in Lori's home office on the right.
hi there!
Answer:
1. cat6 cable
2. wireless ethernet router
3. cat5e cable
Explanation:
1. you need a cat6 cable to be capable to deliver the gigabyte ethernet data to the network device.
2. you need a wireless device to provide wireless connection to her notebook.
3. for a printer no cat6 is necessary you can use cat5e cable and it will be enough.
hope this helps.
Connection to the gigabit ethernet network must be done with Cat6 Cable. Using the wireless ethernet router as the network device and connecting the cable to the printer must be done with Cat5e Cable.
We can arrive at this answer because:
The Cat6 Cable will be responsible for establishing a bridge between the gigabyte Ethernet and the network device, allowing data delivery to be made between the two systems.This connection must be made with a wireless device, to keep it more stabilized and it needs, mainly, for the notebook to receive the internet signal. This will be done using the wireless ethernet router.The printer needs a softer, less rigid connection, so a Cat5e cable will be a convenient option.In this case, we can see that using these devices will allow Lori to have a more stable and efficient connection to meet her needs.
More information on network connection at the link:
https://brainly.com/question/8118353
Can someone plss help me!!
Answer:
HTML elements are delineated by tags, written using angle brackets.
Explanation:
Tags such as <img /> and <input /> directly introduce content into the page.
Where are 'if' and 'else' statements shown when printing a document in a word processor?
Answer the question and then your task is to:
Write an algorithm or sequence of instructions that include the IF statement for the document being printed.
Explanation:
cpt price
what does reporter failure mean on adt alarm system
On ADT alarm system, Failure trouble basically means that the monitoring service isn't working properly because of a communication issue with the system. As a result, the home or business is vulnerable.
How does the ADT alarm system function?ADT will strategically place sensors throughout the home to ensure that each zone is covered. The motion then activates a reaction, such as a security light or a camera that begins recording, all through the wireless connection. The movement can also be reported to the ADT monitoring team.
ADT indoor security cameras come with phone security alerts, infrared night vision, a slim design, and secure WiFi. They provide a variety of views for live and recorded feeds and include professional installation.
Failure trouble on an ADT alarm system basically means that the monitoring service isn't working properly due to a communication issue with the system.
Learn more about the ADT alarm system, refer to:
https://brainly.com/question/28199257
#SPJ5
In the context of an ADT alarm system, "reporter failure" typically refers to a communication issue between the alarm panel and the monitoring center.
ADT alarm systems are designed to send signals or reports to a central monitoring station when an alarm event occurs, such as a break-in or a fire. The monitoring center then takes appropriate actions, such as contacting the homeowner or dispatching emergency services.
When the alarm system displays a "reporter failure" message, it indicates that the panel is unable to establish communication with the monitoring center. This can happen due to various reasons, including but not limited to:
Network or internet connectivity issues: If the alarm system relies on an internet or cellular connection to communicate with the monitoring center, any disruptions in the connection can result in a reporter failure.
Learn more about network on:
https://brainly.com/question/29350844
#SPJ6
How has A.I. evolved and helped humanity in recent times?
Answer:
AI has helped many people in these days.
Explanation:
With AI adoption on the rise, the technology is addressing a number of global challenges.
Artificial intelligence is being used to help crack down on illegal activities.
It is helping to tackle over fishing in our ocean.
And it is even being used to address the issue of gender imbalance.
Lacking in movement, action, or change, especially in a way viewed as undesirable or uninteresting�
Question 11 options:
Malicious
Algorithm
Static
Web Browser
Answer:
Static
Explanation:
I just took the test man!
gourmet pizza shop with a
Question 19
What type of competition does Netflix and a movie theater represent for each other?
A Weak direct competition
B Strong direct competition
C Indirect competition
D Global competition
Answer:
B.Strong direct competition.
Explanation:
Netflix can be viewed by anyone and at anytime.
Strong direct competition is the type of competition does Netflix and a movie theatre represent for each other. Hence, option B is correct.
What is Strong direct competition?Direct competition occurs when multiple companies compete for the same market by offering the same product or service. There are several common examples of this.
One is the rivalry between McDonald's and Burger King; specifically, the Whopper and the Big Mac are bitter rivals. Direct competition is when two or more enterprises directly compete for the same potential market by offering almost similar goods or services.
Are actions taken by public authorities or governments to lessen the competitiveness of imported goods and services in comparison to locally produced ones. poor straight competitor The primary concentration is on one product.
Thus, option B is correct.
For more information about Strong direct competition, click here:
https://brainly.com/question/28739321
#SPJ2
This is an image of the ...................... Topology. * If you get it right i will mark you brainlist
Answer:
Tree
Explanation:
Very few games have any sort of narrative, not even a simple one that involves setting the mood through color, sound, environment, and game mechanics.
A.
True
B.
False
Answer:
B. False
Explanation:
Numerous amount of games have narrative, there is an entire genres built around narratives. Any RPG game has a narrative and even bog standard FPS games have some sort of backstory and effects setting a mood.
what type is the combination of an integer and a string
Answer:
Concatenation.
Explanation:
Write any two uses of ruler in word program
Answer:
1.It is used for draw the table, making results and assignments etc.
2.It is used for lining
Explanation:
Hope it helps
#CARRYONLEARNINGoutline how the appropriate features that may be used to ensure that the document is free of spelling and grammatically errors.
Answer:
Answer
Since Sophie often makes a lot of
grammatical and spelling errors in her
document, it might be best for her to use
a feature available in Microsoft Word that
would help her better in understanding
what her mistakes are, which is
something that (D) Explain does.
Explain would tell Sophie which part of
her sentence is wrong, or what word
did she mistype, and what better way to
phrase a sentence to avoid fragmented
ones.
a client has requested adjustments to the arrangement and placement of elements on an image. what does the client want changed?
Considering the situation described above, the client wants the image's recipe to be changed.
What is the Image Recipe?Image Recipes are characteristics of an image or picture. It includes features like shape, size, form, pattern, line, shadow, tone, color, contrast, positive space and negative space, etc.
Given that the client needs adjustments to the arrangement and placement of elements on an image, this is a request for a change in the image recipe.
Hence, in this case, it is concluded that the correct answer is "the client wants the recipe of the image changed."
Learn more about the Image Recipe here: https://brainly.com/question/1605430
Q44. Cell A20 displays an orange background when its value is 5. Changing the value to 6 changes the background color to green. What type of formatting is applied to cell A20
The type of formatting that is applied to cell A20 is called conditional formatting.
Conditional formatting in Excel Sheet enables an easier method of highlighting noteworthy cells or ranges of cells, displaying data by employing data bars, color scales, and icon sets that match particular variations in data.
A conditional format modifies the look of cells based on the conditions you set. The cell range will be formatted provided that the conditions are true; if otherwise, it will be false and the cell range will not form.
Learn more about conditional formatting here:
https://brainly.com/question/25051360
Arrange the code so that the numbers are swapped.
????????????helpppp please
Answer:
I lab u pre haha jok
ano ka gold
How many things can a computer compare at one time?
Answer: billion of items at one time
Explanation: The computer is very capable of comparing items bulk at one time
A network of computers that provides access to information on the web.
Question 13 options:
Phishing
Internet
Antivirus Application
Modem
Answer:
Internet
Explanation:
What is the default folder for text file
documents or download
It depends where you install it to
Answer:
numbers are stored as characters
Explanation:
currently saved in if another folder
Are theese speeds considered slow? (I used Ookla Speedtest)
PING ms
5
DOWNLOAD Mbps
86.54
UPLOAD Mbps
98.21
Answer:
No
Explanation:
They are pretty solid speeds and 5ms for ping is relativley low. If youre planning a large download (100+ gigs) I still recomend giving it a few
hours
In the program below, which two variables have the same scope?
def usernameMaker (strFirst, strLast):
return strFirst + strLast[0]
def passwordMaker (strA, numC):
answer = dogName[0:3]
return answer + str(numC)
# the main part of your program that calls the function
username = usernameMaker ('Chris', 'Smith')
dogName = 'Sammy'
favoriteNumber = 7
password = passwordMaker (dogName,favoriteNumber)
strA and
Answer: num C
Explanation: got it right on edgen
HELP PLEASE!!
which of the following is document content that displays at the top of every page?
Explanation:
that is a trick question if you need help ask your teacher
Answer:
Title
Explanation:
What is my mistake on this code? (Python)
Answer:
Explanation:
bakugo;sup shoto i didnt know you go on here too
the coding has no problems just go and get deki kaminary
What is a banner grab?
6. Which devices of computer is known processing devices? las >
Answer:
CPU is known as processing devices..!
A portfolio is a collection of materials that demonstrates your skills, abilities, achievements, and potential.
Question 22 options:
True
False
A portfolio is a collection of materials that demonstrates your skills, abilities, achievements, and potential.
A portfolio is a living and changing collection of records that reflect your accomplishments, skills, experiences, and attributes. It highlights and showcases samples of some of your best work, along with life experiences, values and achievements. A portfolio does not take the place of a resume, but it can accentuate your abilities and what you can offer in the chosen field.
Find out more about portfolio at: https://brainly.com/question/24811520
Help!!
So I think that someone is tracking my truck with an apple airtag but I don't know for sure. The only apple product I have is an iPad and I don't know how to check if an airtag is near by!!
Answer:
Explanation:
In iOS 13 or iPadOS 14 or later go to Settings > account name > Find My > Find My iPhone/iPad, and disable Find My network.
In macOS 10.15 Catalina or later, go to the Apple ID preference pane, select the iCloud link at left, click the Options button to the right of the Find My Mac item, and uncheck Offline Finding or Find My network (the text varies by macOS version).
If you are in the Slide Master view, what are the steps to add headers and footers?
Answer:
THat is the correct order.
Explanation: