Answer:
A program was written in C++ that allows the user to play the game of Rock, Paper, Scissors against the computer.
Explanation:
Solution
C++ CODE:
#include<iostream>
#include <locale>
#include<string>
#include<cstdlib>
#include<time.h>
using namespace std;
int play(int user,int cpu){
return(user - cpu); //here is just substracting and returning the value entered by user and cpu
}
void display(int choice){ //to display the choices entered by user or cpu
if(choice == 1){ //1 for Rock
cout<<"Rock"<<endl;
}else if(choice == 2){ //2 for Paper
cout<<"Paper"<<endl;
}else{ //3 for Scissors
cout<<"Scissors"<<endl;
}
}
void winner(int win){
if(win == 0){ //if user and cpu entered same value
cout<<"A game is a draw."<<endl;
}else if(win == 1){ //if user entered Paper and cpu entered Rock or if user entered Scissors and cpu entered Paper
cout<<"Hurray You won."<<endl;
}else if(win == -1){ //if user entered Rock and cpu entered Paper or if user entered Paper and cpu entered Scissors
cout<<"CPU won."<<endl;
}else if(win == 2){ //if user entered Scissors and cpu entered Rock
cout<<"CPU won."<<endl;
}else if(win == -2){ //if user entered Rock and cpu entered Scissors
cout<<"Hurray You won."<<endl;
}
}
int cpu_choice(){
srand (time(NULL)); //this function is to generate random from time to time
int cpu = 1000;
while(cpu > 3){ //to generate random number between 1 to 3
cpu = (rand() % cpu) +1;
}
return cpu;
}
int main(){
int choice=0,cpu=0,win=0;
locale loc;
string ch;
cout<<"Enter your choice :"<<endl;
cout<<"1. Rock\n2. Paper\n3. Scissors"<<endl<<"\t";
cin>>ch;ch[0] = toupper(ch[0],loc); //converting the first element to char if by misktake the user have entered lower case
if(ch.compare("Rock") == 0 || ch.compare("Paper") == 0 || ch.compare("Scissors") == 0){ //if choice is correct
cout<<"You: "<<ch<<endl; //display the choice entered by the user
if(ch[0] == 'r' || ch[0] == 'R') choice = 1; //if the user enter rock or Rock
else if(ch[0] == 'p' || ch[0] == 'P') choice = 2; //if the user enter paper or Paper
else if(ch[0] == 's' || ch[0] == 'S') choice = 3; //if the user enter scissors or Scissors
cout<<"CPU: ";
cpu = cpu_choice(); //get cpu choice
display(cpu); //display the choice entered by the cpu using the random number
win = play(choice,cpu); //call the function to play the game and returns the winner
winner(win); //display the winner
}else{ //if entered choice is wrong
cout<<"wrong choice!"<<endl;
}
return 0;
}
Sasha is viewing a primary component of her Inbox in Outlook. She sees that the subject is “Meeting Time,” the message is from her co-worker Trevon, and the message was received on Monday, January 10th. Sasha can also see the contents of the message. Which part of the Inbox is Sasha viewing?
the status bar
the Reading Pane
the message header
the Task List
sasha is viewing the status bar
Answer: Its B, The reading pane
You join Mountain Water Co – an expanding bottled water company as an information security officer. The company wants to do a lot of advertising of its bottled water products through its website. The CEO asks you to review the company website and report if it is secure. After talking to the webmaster you find out the following:
The Web server accepts all connections
No authentication is required
Self-registration is allowed
The web server is connected to the Internet
Is the situation secure? Select all that apply.
a.
Yes. There is no threat to a bottled water company so it is secure.
b.
There is insufficient information available to answer this question.
c.
No. Anything that is connected to the Internet is insecure.
d.
No. The system is allowing everyone to register. Only individuals who are associated with the company should be able to register.
e.
No. If there is no authentication, then anyone with access to the website online can access it. For good security only individuals with certain authorized roles should access a website.
In regards to the above case, My response is c. No. Anything that is connected to the Internet is insecure.
What is meant by computer security?Computer security is known to be a term that can be called cybersecurity. This is seen as a form of protection of computer systems as well as information from any kind of harm, theft, as well as any form of unauthorized use.
Note that Computer hardware is seen to be protected by the same ways or methods that one uses to protect other valuable things.
In the above, there is no method of authentication and as such, In regards to the above case, My response is c. No. Anything that is connected to the Internet is insecure.
Learn more about Computer security from
https://brainly.com/question/25720881
#SPJ1
Which of the following audio file formats is best
suited for listening to music on a portable audio
device?
(A)BWF
(B)RA
(C)Lossy AIFF
(D)WMA
Answer:
D. WMA
Explanation:
The following audio file formats that is the best suited for listening to music on a portable audio device is WMA.
Answer:
(D) is the answer WMA
Explanation:
Give the other person brainliest ↑↑↑
hope it helps
Question 10 of 10
What information system would be most useful in determining what direction
to go in the next two years?
A. Decision support system
B. Transaction processing system
C. Executive information system
D. Management information system
SUBMIT
Answer: C. Executive information system
Explanation: The information system that would be most useful in determining what direction to go in the next two years is an Executive Information System (EIS). An EIS is designed to provide senior management with the information they need to make strategic decisions.
An Executive Information System (EIS) would be the most useful information system in determining what direction to go in the next two years. So, Option C is true.
Given that,
Most useful information about determining what direction to go in the next two years.
Since Executive Information System is specifically designed to provide senior executives with the necessary information and insights to support strategic decision-making.
It consolidates data from various sources, both internal and external, and presents it in a user-friendly format, such as dashboards or reports.
This enables executives to analyze trends, identify opportunities, and make informed decisions about the future direction of the organization.
EIS typically focuses on high-level, strategic information and is tailored to meet the specific needs of top-level executives.
So, the correct option is,
C. Executive information system
To learn more about Executive information systems visit:
https://brainly.com/question/16665679
#SPJ6
A capacitor of capacitance 102/π µF is connected across a 220 V, 50 Hz A.C. mains. Calculate the capacitive reactance, RMS value of current and write down the equations of voltage and current.
Answer:
The capacitive reactance will be "100Ω" and RMS value of current is "2.2 A". A further explanation is provided below.
Explanation:
Given:
\(C =\frac{10^2}{\pi}\times 10^{-6} \ F\)
\(V_{RMS}=220 \ V\)
\(f = 50 \ Hz\)
Now,
The capacitive reactance will be:
⇒ \(X_c=\frac{1}{\omega C} =\frac{1}{2 \pi f C}\)
\(=\frac{1}{2\times \pi\times 50\times \frac{10^{-4}}{\pi} }\)
\(=100 \ \Omega\)
RMS value of current will be:
⇒ \(I_{RMS}=\frac{V_{RMS}}{X_c}\)
\(=\frac{220}{100}\)
\(=2.2 \ A\)
So that,
⇒ \(V_m=220\times \sqrt{2}\)
\(=311 \ V\)
⇒ \(I_m=2.2\times \sqrt{2}\)
\(=3.1 \ A\)
hence,
The equation will be:
⇒ \(\nu=311 sin31 \ 4t\)
and,
⇒ \(i=3.1 sin(314t+\frac{\pi}{2} )\)
this method of file transfer distributes file transfers across many different computers.
Answer: Packet switching.
Explanation: The transfer of small pieces of data across various networks is known as packet switching. The faster and more effective transfer of data is made possible by these data chunks, or "packets." When a user transmits a file over a network, it is frequently transmitted in smaller data packets rather than as a single unit.
A program checks to see if the input is valid using
numbers
operators
logic
output
Use the knowledge in computational language in python program checks to see if the input is output.
How to define input in Python?In Python, we do this using the input() function, which is literally 'input' in English. The input() function receives as a parameter a string that will be shown as an aid to the user, usually informing him what kind of data the program is expecting to receive.
So in an easier way we have that the code is:
def isNumber(x):
if type(x) == int:
return True
else:
return False
input1 = 122
input2 = '122'
if isNumber(input1):
print("Integer")
else:
print("String")
if isNumber(input2):
print("Integer")
else:
print("String")
See more about python at brainly.com/question/18502436
Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics and federal problem-solvers. How might that explain some of the security vulnerabilities present in the “cloud” today?
It should be noted that the intention for the creation of the internet was simply for resources sharing.
The motivation behind the creation of the internet was for resources sharing. This was created as a tool for academics and federal problem-solvers.
It transpired as it wasn't for its original purpose anymore. Its users employed it for communication with each other. They sent files and softwares over the internet. This led to the security vulnerabilities that can be seen today.
Learn more about the internet on:
https://brainly.com/question/2780939
Which of the following devices would most likely have a 4G connection
Laptop
Mobile phone
Workstation
Server
What feature allows a person to key on the new lines without tapping the return or enter key
The feature that allows a person to key on new lines without tapping the return or enter key is called word wrap
How to determine the featureWhen the current line is full with text, word wrap automatically shifts the pointer to a new line, removing the need to manually press the return or enter key.
In apps like word processors, text editors, and messaging services, it makes sure that text flows naturally within the available space.
This function allows for continued typing without the interruption of line breaks, which is very helpful when writing large paragraphs or dealing with a little amount of screen space.
Learn more about word wrap at: https://brainly.com/question/26721412
#SPJ1
Please help I have no idea what to do :(
Write a program that simulates a coin flipping. Each time the program runs, it should print either “Heads” or “Tails”.
There should be a 0.5 probability that “Heads” is printed, and a 0.5 probability that “Tails” is printed.
There is no actual coin being flipped inside of the computer, and there is no simulation of a metal coin actually flipping through space. Instead, we are using a simplified model of the situation, we simply generate a random probability, with a 50% chance of being true, and a 50% chance of being false.
A Java Script program that simulates a coin flipping, so that each time the program runs, it should print either “Heads” or “Tails” along with the other details given is stated below.
Code for the above coin simulationvar NUM_FLIPS = 10;
var RANDOM = Randomizer.nextBoolean();
var HEADS = "Heads";
var TAILS = "Tails";
function start(){
var flips = flipCoins();
printArray(flips);
countHeadsAndTails(flips);
}
// This function should flip a coin NUM_FLIPS
// times, and add the result to an array. We
// return the result to the caller.
function flipCoins(){
var flips = [];
for(var i = 0; i < NUM_FLIPS; i++){
if(Randomizer.nextBoolean()){
flips.push(HEADS);
}else{
flips.push(TAILS);
}
}
return flips;
}
function printArray(arr){
for(var i = 0; i < arr.length; i++){
println("Flip Number " + (i+1) + ": " + arr[i]);
}
}
function countHeadsAndTails(flips){
var countOne = 0;
var countTwo = 0;
for(var i = 0; i < flips.length; i++){
if(flips[i] == HEADS){
countOne+=1;
}
else {
countTwo+=1;
}
}
println("Number of Heads: " + countOne);
println("Number of Tails: " + countTwo);
}
Learn more about Java Script:
https://brainly.com/question/18554491
#SPJ1
can someone please help its done in 3 hours
Answer:
What
Explanation:
Help with what
Test if a password entered is correct. The secret phrase is Ada Lovelace.
Sample Run 1
Enter the Password: Ada Lovelace
Sample Output 1
Correct!
Sample Run 2
Enter the Password: Blaise Pascal
Sample Output 2
Not Correct
for Python
password = "Ada Lovelace"
if input("Enter the Password: ") == password:
print("Correct!")
else:
print("Not Correct")
I wrote my code in python 3.8. I hope this helps.
List three hardware computer components? Describe each component, and what its function is.
Answer:
moniter: a screen and is used to see what the computer is running
webcam: the camera on the computer. can be already built in or added
power supply: an electrical device that supplies power to an electrical load
Explanation:
Answer:
Input device
output device
C.P.U
all flowcharts begin with me.i am elliptical in shape.
Note that it is FALSE to state that "all flowcharts begin with me.i am elliptical in shape."
How is this so?While it is common for flowcharts to start with a shape, typically represented as an oval or rounded rectangle, it is not always an elliptical shape.
The starting point of a flowchart can vary depending on the specific system or process being depicted.
The purpose of the initial shape is to indicate the beginning or initiation of the flowchart, and it can take various forms depending on the conventions and preferences of the flowchart designer.
Learn more about flow charts at:
https://brainly.com/question/6532130
#SPJ1
Full Question:
Although part of your question is missing, you might be referring to this full question:
All flowcharts begin with me.i am elliptical in shape. True or False?
Make sure your animal_list.py program prints the following things, in this order:
The list of animals 1.0
The number of animals in the list 1.0
The number of dogs in the list 1.0
The list reversed 1.0
The list sorted alphabetically 1.0
The list of animals with “bear” added to the end 1.0
The list of animals with “lion” added at the beginning 1.0
The list of animals after “elephant” is removed 1.0
The bear being removed, and the list of animals with "bear" removed 1.0
The lion being removed, and the list of animals with "lion" removed
Need the code promise brainliest plus 100 points
Answer:#Animal List animals = ["monkey","dog","cat","elephant","armadillo"]print("These are the animals in the:\n",animals)print("The number of animals in the list:\n", len(animals))print("The number of dogs in the list:\n",animals.count("dog"))animals.reverse()print("The list reversed:\n",animals)animals.sort()print("Here's the list sorted alphabetically:\n",animals)animals.append("bear")print("The new list of animals:\n",animals)
Explanation:
xamine the following output:
Reply from 64.78.193.84: bytes=32 time=86ms TTL=115
Reply from 64.78.193.84: bytes=32 time=43ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=47ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=73ms TTL=115
Reply from 64.78.193.84: bytes=32 time=46ms TTL=115
Which of the following utilities produced this output?
The output provided appears to be from the "ping" utility.
How is this so?Ping is a network diagnostic tool used to test the connectivity between two network devices,typically using the Internet Control Message Protocol (ICMP).
In this case, the output shows the successful replies received from the IP address 64.78.193.84,along with the response time and time-to-live (TTL) value.
Ping is commonly used to troubleshoot network connectivity issues and measureround-trip times to a specific destination.
Learn more about utilities at:
https://brainly.com/question/30049978
#SPJ1
Name the computer crime that has to do with posting false information/ accusations about another person online.
Answer:
cyberstalking
Explanation:
Consider the following declaration:
String s = "cat";
Which of the following statements assigns the number of characters in s to k?
A. int k = s.length;
B. int k = s.length();
C. int k = s.size;
D. int k = s.size();
Consider the following declarations:
String s1 = "apple";
String s2 = "apple";
What is the result of s1.compareTo(s2)?
A. true
B. false
C. 0
D. 1
Consider the following declarations:
String s1 = "apple";
String s2 = "APPLE";
Which of the following expressions is true?
A. s1.equals(s2) && s1.equalsIgnoreCase(s2)
B. !s1.equals(s2) && s1.equalsIgnoreCase(s2)
C. s1.equals(s2) && !s1.equalsIgnoreCase(s2)
D. !s1.equals(s2) && !s1.equalsIgnoreCase(s2)
Answer:
B, C, B
Explanation:
According to my understanding of these questions, these are in Java.
For the first one, there is a built in function called .length() for a string, so it's answer B.
For the second one, this should come out as C, 0 since compareTo compares the ascii values of the characters.
The third one's answer should be B. s1.equals(s2) for characters that are caps and not caps comes out with false, so ! would negate it. s1.equalsIgnoreCase(s2) would come out as true, ignoring the cases of APPLE.
OBJECTIVE QUESTIONS
1. In a computer keyboard the Alt, Ctrl, Shift, Del & Insert
keys are known as
Answer:
A modifier
Explanation:
because this modified a computer keyboard
Which of the following tactics can reduce the likihood of injury
The tactics that can reduce the likelihood of injury in persons whether at work, at home or wherever:
The Tactics to reduce injury risksWearing protective gear such as helmets, knee pads, and safety goggles.
Maintaining proper body mechanics and using correct lifting techniques.
Regularly participating in physical exercise and strength training to improve overall fitness and coordination.
Following traffic rules and wearing seatbelts while driving or using a bicycle.
Ensuring a safe and well-lit environment to minimize the risk of falls or accidents.
Using safety equipment and following guidelines in sports and recreational activities.
Being aware of potential hazards and taking necessary precautions in the workplace or at home.
Read more about injuries here:
https://brainly.com/question/19573072
#SPJ1
A computer is a system. Justify this statement.
Answer:
A computer system is a set of integrated devices that input, output, process, and store data and information. Computer systems are currently built around at least one digital processing device. There are five main hardware components in a computer system: Input, Processing, Storage, Output and Communication devices.
Explanation:
Please mark as brainlist.
The nth Fibonacci number Fn is defined as follows: F0 = 1, F1 = 1 and Fn = Fn−1 + Fn−2 for n > 1.
In other words, each number is the sum of the two previous numbers in the sequence. Thus the first several Fibonacci numbers are 1, 1, 2, 3, 5, and 8. Interestingly, certain population growth rates are characterized by the Fibonacci numbers. If a population has no deaths, then the series gives the size of the poulation after each time period.
Assume that a population of green crud grows at a rate described by the Fibonacci numbers and has a time period of 5 days. Hence, if a green crud population starts out as 10 pounds of crud, then after 5 days, there is still 10 pounds of crud; in 10 days, there is 20 pounds of crud; in 15 days, 30 pounds of crud; in 20 days, 50 pounds of crud, and so on.
Write a program that takes both the initial size of a green crud population (in pounds) and some number of days as input from the keyboard, and computes from that information the size of the population (in pounds) after the specified number of days. Assume that the population size is the same for four days and then increases every fifth day. The program must allow the user to repeat this calculation as long as desired.
Please note that zero is a valid number of days for the crud to grow in which case it would remain at its initial value.
You should make good use of functions to make your code easy to read. Please use at least one user-defined function (besides the clearKeyboardBuffer function) to write your program.
basically I've done all the steps required except the equation in how to get the final population after a certain period of time (days). if someone would help me with this, I'll really appreciate it.
In Python, it can be expressed as follows. Using the recursive function type, we find the sum of the previous term and the sum of the two previous terms.
Python:x=int(input("Initial size: "))
y=int(input("Enter days: "))
mod=int(y/5)-1
def calc(n):
gen_term = [x,2*x]
for i in range(2, n+1):
gen_term.append(gen_term[i-1] + gen_term[i-2])
return gen_term[n]
if(mod==0):
print("After",y,"days, the population is",x)
else:
print("After",y,"days, the population is",calc(mod))
what is information technology
Explanation:
The study or use of electronic equipment, especially computers, for collecting, storing and send out information.Information technology is the use of computers to store, retrieve transmit, and manipulate data, or information.
Remember to save _____ and be certain that you have your files saved before closing out.
The White House spokesman said that if the relevant bill was sent to the desk, US President Biden would sign to end the national emergency of COVID-19 in advance, although he strongly opposed it. The US Senate will vote on the evening of the 29th local time and is expected to pass
The requirement for the Senate to vote on the bill is a standard legislative process in the United States.
Why the senate votes on billsIn order for a bill to become law, it needs to be approved by both the House of Representatives and the Senate. The legislative branch of the US government is divided into two chambers—the House of Representatives and the Senate—each with its own set of responsibilities.
Once a bill is introduced in either chamber, it goes through a series of committee reviews, debates, and amendments before being put to a vote.
Read more on bills here https://brainly.com/question/29613391
#SPJ1
The White House spokesman said that if the relevant bill was sent to the desk, US President Biden would sign to end the national emergency of COVID-19 in advance, although he strongly opposed it. The US Senate will vote on the evening of the 29th local time and is expected to pass
Why does the senate have to vote on a bill
What is the controller in this image know as? Choose one
Answer:
mode dial
Explanation:
Which of the following would you use to search a table in excel?
Decenter
Merge
Find and select
Clear rules
find four
reasons
Why must shutdown the system following the normal sequence
If you have a problem with a server and you want to bring the system down so that you could then reseat the card before restarting it, you can use this command, it will shut down the system in an orderly manner.
"init 0" command completely shuts down the system in an order manner
init is the first process to start when a computer boots up and keep running until the system ends. It is the root of all other processes.
İnit command is used in different runlevels, which extend from 0 through 6. "init 0" is used to halt the system, basically init 0
shuts down the system before safely turning power off.
stops system services and daemons.
terminates all running processes.
Unmounts all file systems.
Learn more about server on:
https://brainly.com/question/29888289
#SPJ1
Choose the words that make the statement true. You wrote a program called firstProgram.
Your program is _____.
O always running in the background
O stored until you open the file
Answer:
Stored until you open the file
Explanation:
Your program is stored until you open the file.
-edge 2022
You wrote a program called first Program. Your program is stored until you open the file. The second option is correct.
What is program?A program is made from code of instructions. A program is saved for later use.
When a program is opened, it is in running condition until it is closed. But when it is not in use, it gets stored at a location for next use.
You wrote a program called first Program. Your program is stored until you open the file.
Thus, the second option is correct.
Learn more about program.
https://brainly.com/question/3224396
#SPJ2