some context free languages are undecidable
Which functions are examples of logical test arguments used in formulas? Check all that apply.
OR, IF, NOT,AND are the examples of logical test arguments used in formulas
What function is used for logical testing?The IF function, for instance, runs a logical test and returns one value if the result is TRUE and a different value if the result is FALSE. In logical operations, a logical test is used to assess the contents of a cell location.The logical test's findings can be either true or untrue.For instance, depending on the value entered into cell C7, the logical test C7 = 25 (read as "if the value in cell C7 is equal to 25") may or may not be true. A logical test entails the system checking for a predetermined condition, and if it does, it will present the results in Excel in accordance with logic.If a student receives more than 35 marks, for example, we can consider them to have passed; otherwise, they would have failed. The most well-known member of the family of logic functions is the AND function.It is useful when you need to test multiple conditions and make sure they are all met.Technically, the AND function evaluates the conditions you provide and returns TRUE if every condition does, else FALSE.To learn more about logical testing refer
https://brainly.com/question/14474115
#SPJ1
List the average salary and years of experience
for each job in your career path.
Provide a detailed job description for an entry
level (1-2 years' experience) position and any
certifications required.
Provide a detailed job description for a mid-level
(4-5 years' experience) position and any
certifications required.
What is steering you toward this path?
You will construct, test, and maintain software applications as a beginning software developer while working under the direction of more experienced developers. You will be in charge of writing and debugging code.
What four different professional pathways are there?You can choose from the traditional, network, lateral, or dual career pathways. From one particular job to the next, an employee moves vertically up the organisation. a career pathing approach that includes both a horizontal array of prospects and a vertical hierarchy of employment.
What would you say your job path entails?A succession of jobs that get you closer to your career goals and life goals can be referred to as a career path. Some folks move linearly through a single field.
To know more about software visit:-
https://brainly.com/question/985406
#SPJ9
In a ______ attack the attacker creates a series of DNS requests containing the spoofed source address for the target system. DNS amplification.
In a DNS attack the attacker creates a series of DNS requests containing the spoofed source address for the target system.
What is the purpose of a DNS attack?The attacker compromises a DNS server by changing a valid IP address in the server’s cache with a rogue address in order to divert traffic to a malicious website, collect information, or launch another attack. Cache poisoning is also known as DNS poisoning. DNS poisoning (also known as DNS spoofing) and its cousin, DNS cache poisoning, divert internet traffic to malicious websites by exploiting security flaws in the DNS protocol. These are known as man-in-the-middle attacks.
This spyware is designed to seem like legal software. Once activated, it grants hackers access to network infrastructure, allowing attackers to steal data and change DNS settings to divert users to bogus websites.
To learn more about DNS Attack refer:
https://brainly.com/question/17113669
#SPJ4
Answer
Explanation
Ramshewak goes to market for buying some fruits and vegetables. He ishaving a currency of Rs 500 with him for marketing. From a shop he purchases 2.0 kg Apple priced Rs. 50.0 per kg, 1.5 kg Mango priced Rs.35.0 per kg, 2.5 kg Potato priced Rs.10.0 per kg, and 1.0 kg Tomato priced Rs.15 per kg. He gives the currency of Rs. 500 to the shopkeeper. Find out the amount shopkeeper will return to Ramshewak. and also tell the total item purchased. write the algorithm to the problem
Answer:
Explanation:
To find the amount that the shopkeeper will return to Ramshewak and the total items purchased, we can use the following algorithm:
Set the initial amount paid by Ramshewak to the shopkeeper as 500.
Calculate the cost of 2.0 kg of apples at Rs. 50 per kg: 2.0 x 50 = 100
Add the cost of apples to the initial amount: 500 + 100 = 600
Calculate the cost of 1.5 kg of mangoes at Rs. 35 per kg: 1.5 x 35 = 52.5
Add the cost of mangoes to the total amount: 600 + 52.5 = 652.5
Calculate the cost of 2.5 kg of potatoes at Rs. 10 per kg: 2.5 x 10 = 25
Add the cost of potatoes to the total amount: 652.5 + 25 = 677.5
Calculate the cost of 1.0 kg of tomatoes at Rs. 15 per kg: 1.0 x 15 = 15
Add the cost of tomatoes to the total amount: 677.5 + 15 = 692.5
Subtract the total amount from the initial amount paid by Ramshewak to find the amount that the shopkeeper will return: 500 - 692.5 = -192.5
Since the total amount of the items purchased is Rs. 692.5 and Ramshewak paid Rs. 500, the shopkeeper will return Rs. 192.5 to Ramshewak.
Algorithm:
Set initial amount paid by Ramshewak to 500
Calculate cost of 2.0 kg of apples at Rs. 50 per kg
Add cost of apples to the initial amount
Calculate cost of 1.5 kg of mangoes at Rs. 35 per kg
Add cost of mangoes to the total amount
Calculate cost of 2.5 kg of potatoes at Rs. 10 per kg
Add cost of potatoes to the total amount
Calculate cost of 1.0 kg of tomatoes at Rs. 15 per kg
Add cost of tomatoes to the total amount
Subtract total amount from initial amount paid by Ramshewak to find amount shopkeeper will return to Ramshewak.
Given main.py and a Node class in Node.py, complete the LinkedList class (a linked list of nodes) in LinkedList.py by writing the insert_in_ascending_order() method that inserts a new Node into the LinkedList in ascending order.
Ex: If the input is:
8 3 6 2 5 9 4 1 7
the output is:
1 2 3 4 5 6 7 8 9
So, after finagling and wracking my brain I've gotten to this point with the code, but here's the issue;
Here's the code:
class LinkedList:
def __init__(self):
self.head = None
self.tail = None
def append(self, new_node):
if self.head == None:
self.head = new_node
self.tail = new_node
else:
self.tail.next = new_node
self.tail = new_node
def prepend(self, new_node):
if self.head == None:
self.head = new_node
self.tail = new_node
else:
new_node.next = self.head
self.head = new_node
def insert_after(self, current_node, new_node):
if self.head == None:
self.head = new_node
self.tail = new_node
elif current_node is self.tail:
self.tail.next = new_node
self.tail = new_node
else:
new_node.next = current_node.next
current_node.next = new_node
def insert_in_ascending_order(self, new_node):
if self.head == None or new_node.data < self.head.data:
new_node.next = self.head
self.head = new_node
else:
cur_node = self.head
while cur_node.next != None and new_node.data > cur_node.next.data:
cur_node = cur_node.next
cur_node.next = new_node
def remove_after(self, current_node):
# Special case, remove head
if (current_node == None) and (self.head != None):
succeeding_node = self.head.next
self.head = succeeding_node
if succeeding_node == None: # Remove last item
self.tail = None
elif current_node.next != None:
succeeding_node = current_node.next.next
current_node.next = succeeding_node
if succeeding_node == None: # Remove tail
self.tail = current_node
def print_list(self):
cur_node = self.head
while cur_node != None:
cur_node.print_node_data()
print(end=' ')
cur_node = cur_node.next
Here's the INPUT:
8 3 6 2 5 9 4 1 7
Here's my OUTPUT:
1 2 7
What can I do? Why does it only output 3 integers? I feel like the issue must be in my def remove_after section, however that was base code in the assignment (which I'm not necessarily supposed to change).
Create a Python program that prints all the numbers from 0 to 4 except two distinct numbers entered by the user.
Note : Use 'continue' statement.
Here is a Python program that prints all numbers from 0 to 4, excluding two distinct numbers entered by the user, using the 'continue' statement:
```python
numbers_to_exclude = []
# Get two distinct numbers from the user
for i in range(2):
num = int(input("Enter a number to exclude: "))
numbers_to_exclude.append(num)
# Print numbers from 0 to 4, excluding the user-entered numbers
for i in range(5):
if i in numbers_to_exclude:
continue
print(i)
```
The program first initializes an empty list called `numbers_to_exclude` to store the two distinct numbers entered by the user.
Next, a loop is used to prompt the user to enter two distinct numbers. These numbers are appended to the `numbers_to_exclude` list.
Then, another loop is used to iterate through the numbers from 0 to 4. Inside the loop, an 'if' condition is used to check if the current number is in the `numbers_to_exclude` list. If it is, the 'continue' statement is executed, which skips the current iteration and proceeds to the next iteration of the loop.
If the current number is not in the `numbers_to_exclude` list, the 'print' statement is executed, and the number is printed.
This program ensures that the two distinct numbers entered by the user are excluded from the output, while all other numbers from 0 to 4 are printed.
For more such answers on Python
https://brainly.com/question/26497128
#SPJ8
What happens during a SQL interjection?
A.
XML input is affected
B.
a syntax error occurs
C.
LDAP statements are exploited
D.
system operations are affected
Answer:
SQL injection attacks allow attackers to spoof identity, tamper with existing data, cause repudiation issues such as voiding transactions or changing balances, allow the complete disclosure of all data on the system, destroy the data or make it otherwise unavailable, and become administrators of the database server.PLEASE HELP IN JAVA
A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings), separated by a comma. That list is followed by a name, and your program should output the phone number associated with that name. Output "None" if name is not found. Assume that the list will always contain less than 20 word pairs.
Ex: If the input is:
3 Joe,123-5432 Linda,983-4123 Frank,867-5309 Frank
the output is:
867-5309
Your program must define and call the following method. The return value of getPhoneNumber() is the phone number associated with the specific contact name.
public static String getPhoneNumber(String[] nameArr, String[] phoneNumberArr, String contactName, int arraySize)
Hint: Use two arrays: One for the string names, and the other for the string phone numbers.
Answer: import java.util.Scanner;
public class ContactList {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
// Read the number of word pairs in the list
int n = scnr.nextInt();
scnr.nextLine(); // Consume the newline character
// Read the word pairs and store them in two arrays
String[] names = new String[n];
String[] phoneNumbers = new String[n];
for (int i = 0; i < n; i++) {
String[] parts = scnr.nextLine().split(",");
names[i] = parts[0];
phoneNumbers[i] = parts[1];
}
// Read the name to look up
String name = scnr.nextLine();
// Call the getPhoneNumber method to look up the phone number
String phoneNumber = getPhoneNumber(names, phoneNumbers, name, n);
// Print the phone number, or "None" if the name is not found
if (phoneNumber != null) {
System.out.println(phoneNumber);
} else {
System.out.println("None");
}
}
public static String getPhoneNumber(String[] nameArr, String[] phoneNumberArr, String contactName, int arraySize) {
// Search for the name in the array and return the corresponding phone number
for (int i = 0; i < arraySize; i++) {
if (nameArr[i].equals(contactName)) {
return phoneNumberArr[i];
}
}
// If the name is not found, return null
return null;
}
}
Explanation: The program inputs the number of word sets, stores them in two clusters (names and phoneNumbers), and looks up a title by calling the getPhoneNumber strategy to return the comparing phone number. Prints phone number or "None" in the event that title not found. getPhoneNumber strategy takes nameArr, phoneNumberArr, contactName, and arraySize as contentions. The strategy looks for a title and returns the phone number in case found, something else invalid.
The security administrator for Corp.com. You are explaining to your CIO the value of credentialed scanning over non-credentialed scanning. In credentialed scanning, policy compliance plugins give you which advantage?
In credentialed scanning, policy compliance plugins give you an advantage known as option C: Customized auditing.
What does auditing serve to accomplish?The goal of an audit is to determine if the financial report's information, taken as a whole, accurately depicts the organization's financial situation as of a particular date. For instance, is the balance sheet accurately recording the organization's assets and liabilities?
Therefore since the goal of such a tailored audit, aside from cost and time savings, so, it is to present an objective overall picture of your supplier's organization in all pertinent disciplines, allowing you to better target risk areas and allocate control resources where they are most needed.
Learn more about Customized auditing from
https://brainly.com/question/7890421
#SPJ1
See full question below
The security administrator for Corp.com. You are explaining to your CIO the value of credentialed scanning over non-credentialed scanning. In credentialed scanning, policy compliance plugins give you which advantage?
More accurate results
Safer scanning
Customized auditing
Active scanning
can you answer my intro to computer applications CIS-100 fron spring uma college
CIS-100 is an intro course covering various computer applications. Offered during Spring at UMA College, it equips students with necessary computer tech skills for their personal and professional lives.
What is computer applications?CIS-100 covers computer hardware, software, and operating systems.
In terms of Internet and Web: Overview of how the Internet works, network protocols, and effective use of web browsers and search engines.
Lastly, in terms of Productivity software: Use of word processing, spreadsheets, and presentation tools to manage documents. Database management introduces concepts like tables, fields, and records, as well as systems like Microsoft Access.
Learn more about computer applications from
https://brainly.com/question/24264599
#SPJ1
Provide a written response that:
describes the overall purpose of the program
describes the functionality of your app
describes the input and outputs of your app
Answer:
Not securely held or in position *
1 point
Brink
Lope
Precarious
Cajole
Explanation:
Not securely held or in position *
1 point
Brink
Lope
Precarious
Cajole
Create an MLB Teams subclass in this module and it should inherit from the Professional Sports Team class. The subclass should have an __init__ method that ties it to the MLB Teams class and creates the following additional attributes.
__mascot
__team_batting_average
__team_pitching_ERA
The given below is the code for the given scenario.
What is Inheritance?
Inheritance allows you to define a class that inherits all its methods and properties from another class. The parent class is the class from which it inherits, also called the base class. A child class is a class that inherits from another class, also called a derived class.
Code:
class Professional_Sports_Team:
# Directory class will create an object that stores the team name,
# home city and sport played.
def __init__(self, team_name, home_city, sport):
self.__team_name = team_name
self.__home_city = home_city
self.__sport = sport
# Mutators/Setters
def set_team_name(self, team_name):
self.__team_name = team_name
def set_home_city(self, home_city):
self.__home_city = home_city
def set_sport(self, sport):
self.__sport = sport
# Accessors/Getters
def get_team_name(self):
return self.__team_name
def get_home_city(self):
return self.__home_city
def get_sport(self):
return self.__sport
# MLB Teams subclass should inherit from the Professional Sports Team class MLB_Team(Professional_Sports_Team):
def __init__(self, team_name, home_city, sport, mascot,team_batting_average, team_pitching_ERA):
# call super class constructor
super(MLB_Team, self).__init__(team_name, home_city,sport) self.____mascot = mascot
self.__team_batting_average = team_batting_average self.__team_pitching_ERA = team_pitching_ERA
# This method assigns a string to the __mascot field.
def set_mascot(self, mascot):
self.____mascot = mascot
# This method assigns a value to the __team_batting_average field.
def set_team_batting_average(self, team_batting_average): self.__team_batting_average = team_batting_average
# This method assigns a value to the __team_pitching_ERA field.
def set_team_pitching_ERA(self, set_team_pitching_ERA): self.__team_pitching_ERA = set_team_pitching_ERA
# This method returns the string of the __mascot field.
def get_mascot(self):
return self.____mascot
# This method returns the value from the __team_batting_average field. def get_team_batting_average(self):
return self.__team_batting_average
# This method returns the value from the __team_pitching_ERA field. def get_team_pitching_ERA(self):
return self.__team_pitching_ERA
Class information including team name, hometown and sport played is already available here. It also contains all the setters/getters for those attributes. You should create a subclass based on the classes defined in this module with getters and setters. This activity requires you to upload the modified module file along with the other files.
To learn more about Inheritance and Code, click on the given link: https://brainly.com/question/15078897
#SPJ4
The issue “when a user deletes the data, whether all the copies are deleted or not is something that every needs to have a clear answer to” comes under which of the following?
The issue “when a user deletes the data, whether all the copies are deleted or not is something that every needs to have a clear answer to” comes under aspect of data deletion and data lifecycle management.
What is the deletion?One need rules and practices to delete data to follow privacy laws, protect data, and meet user expectations. When a user gets rid of data, it is important to check if all copies of that data have been effectively removed from the system or storage.
Data Retention Policies: Organizations must create clear rules about how long they will keep certain data before getting rid of it.
Read more about deletion here:
https://brainly.com/question/30280833
#SPJ1
Declare an array to store objects of the class defined by the UML above. Use a method from the JOptionPane class to request the length of the array from the user.
There is an `ElectionTest` class that contains the `main` method. Inside the `main` method, use the `JOptionPane.showInputDialog` method to display a dialog box and request the length of the array from the user. The entered value is then parsed as an integer and stored in the `arrayLength` variable.
How did we declare it?To declare an array to store objects of the class defined by the given UML diagram and request the length of the array from the user using a method from the `JOptionPane` class, use the following Java code:
java
import javax.swing.JOptionPane;
public class ElectionTest {
public static void main(String[] args) {
// Request the length of the array from the user
int arrayLength = Integer.parseInt(JOptionPane.showInputDialog("Enter the length of the array:"));
// Declare the array to store Election objects
Election[] elections = new Election[arrayLength];
// Perform operations with the Election objects as required
// ...
}
}
class Election {
private String candidate;
private int numVotes;
public Election() {
// Default constructor
}
public Election(String candidate, int num Votes) {
this.candidate = candidate;
this.numVotes = num Votes;
}
public void set Candidate(String candidate) {
this.candidate = candidate;
}
public void set NumVotes (int num Votes) {
this.numVotes = num Votes;
}
public int getNumVotes() {
return num Votes;
}
at Override
public String toString() {
return "Candidate: " + candidate + ", Votes: " + numVotes;
}
}
```
In this code, there is an `ElectionTest` class that contains the `main` method. Inside the `main` method, use the `JOptionPane.showInputDialog` method to display a dialog box and request the length of the array from the user. The entered value is then parsed as an integer and stored in the `arrayLength` variable.
Next, declare an array of type `Election` called `elections` with the specified length obtained from the user.
learn more about java code: https://brainly.com/question/25458754
#SPJ1
Consider a logical address space with 32 pages, how many bits must be used to represent the page number in the logical address?
Question:
Consider a logical address space with 32 pages of 1024 words, how many bits must be used to represent the page number in the logical address?
Answer:
15 bits.
Explanation:
Given:
A logical address space has 32 pages of 1024 words.
To represent these 32 pages, 5 bits are needed. i.e
32 = 2⁵
Also, each page contains 1024 words. This means that 10 bits will be needed for addressing within each 1024-word page. i.e
1024 = 2¹⁰
The total number of bits is the sum of the number of bits required for the pages and the number of bits required for addressing within each 1024-word page. i.e
5 + 10 = 15.
Therefore, the logical addresses must be 15 bits.
How to start Microsoft acess
Answer:
As with most Windows programs, Access can be executed by navigating the Start menu in the lower left-hand corner of the Windows Desktop. To start Access, click on the Start button, then the Programs menu, then move to the Microsoft Office menu and finally click on the Microsoft Access menu item.
bob is sending a message to alice. he wants to ensure that nobody tampers with the message while it is in transit. what goal of cryptography is bob attempting to achieve?
He wants to make certain that the communication through message is not tampered with while in transit. The integrity of cryptography is bob attempting to achieve.
What do you mean by message?
A message is a distinct unit of communication intended for consumption by some recipient or set of recipients by the source. A message can be conveyed via courier, telegraphy, carrier pigeon, or electronic bus, among other methods. A broadcast's content can be a message. A conversation is formed through an interactive exchange of messages. A press release is an example of a communication, which can range from a brief report or statement issued by a government body to commercial publicity material.
To learn more about message
https://brainly.com/question/25660340
#SPJ13
Define network and list 5 components of a typical network setup
1 : What format would you apply to give an entry the appearance of 12-Mar-2014
Accounting Number
imput
Calendar
Date
2: When you add a columm where did it appear
Answer:
1. Date 2. It will appear to the right of the selected column.
Python (and most programming languages) start counting with 0.
True
False
Answer:
yes its true :)
Explanation:
please help me with this coding assignment :)
What values are stored in nums after the following code segment has been executed?
int[] nums = {50, 100, 150, 200, 250};
for (int n : nums)
{
n = n / nums[0];
}
[1, 2, 3, 4, 5]
[1, 1, 1, 1, 1]
[1, 100, 150, 200, 250]
[50, 100, 150, 200, 250]
Answer:
D. [50, 100, 150, 200, 250]
Explanation:
This is a trick question because the integer n is only a counter and does not affect the array nums. To change the actual array it would have to say...nums[n] = n/nums[0];
Pls answer 10 points
Answer:
1. C
5.b
Explanation:
1. Is c because it is in the short cut key
5. Is B because it is the last choice
1. C
5.b
Explanation:
1. Is c because it is in the short cut key
5. Is B because it is the last choice
which wireless technology connects with most mobile devices?
Answer:
¡) Internet
¡¡) Alexa
¡¡¡) Electronic Devices
The wireless technology that connects with most mobile devices is
Wi-Fi.
We have,
Wi-Fi is widely available and compatible with a vast range of smartphones, tablets, laptops, and other mobile devices, making it a popular choice for wireless connectivity.
Wi-Fi has become ubiquitous and widespread due to its convenience, flexibility, and high data transfer rates.
Most modern mobile devices come equipped with Wi-Fi capabilities, enabling users to connect to Wi-Fi networks and access the internet without the need for physical cables. It allows for seamless and reliable internet connectivity, enabling users to access online services, browse the web, stream media, send emails, and use various applications on their mobile devices while on the go or within the coverage area of a Wi-Fi network.
Thus,
The wireless technology that connects with most mobile devices is
Wi-Fi.
Learn mroe about wireless technologies here:
https://brainly.com/question/32338552
#SPJ3
an information system is a collection of people, procedures, software, hardware, data, and connectivity. t/f
True. An information system is a combination of hardware, software, data, and people that work together to collect, store, process, and communicate information.
The hardware component includes the physical components of the system such as computers, networking equipment, and other technology. The software component includes the software applications used to store, process, and communicate information.
The people component includes the users of the system, such as administrators, users, and developers. The data component includes the information stored in the system, such as databases, documents, and other files. Finally, the connectivity component includes the physical connections between the components of the system, such as the internet, cables, and routers.
For more questions like Information system click the link below:
https://brainly.com/question/14520413
#SPJ4
a) The Manager of Sahem Bank wants an Automated Teller Machine (ATM) that will enable customers of the bank perform certain bank transactions such as withdrawal. They want the ATM to allow a customer to withdraw maximum of GHC 1000.00 per day. If the customer attempts withdrawing more than GHC 1000.00, the ATM inform the customer it cannot withdraw more than GHC 1000.00. If the amount the customer attempts withdrawing is more than the available balance, it should prompt the customer about the insufficient balance. It should give the option of withdrawing an amount less than the balance. Write an pseudocode and draw a flow chart for the ATM withdrawal transactions.
Prompt the user to insert their ATM card.
Verify the validity of the card.
Prompt the user to enter their PIN.
Verify the PIN and proceed to the next step if it is correct.
Display the menu of transactions available.
If the customer chooses to withdraw, prompt the customer to enter the amount to withdraw.
Verify that the amount is not more than GHC 1000.00 and that the customer has sufficient balance.
If the amount is more than GHC 1000.00, display a message that the customer cannot withdraw more than GHC 1000.00.
If the customer does not have sufficient balance, display a message that the balance is insufficient and give the option to withdraw an amount less than the balance.
Dispense the cash to the customer if all conditions are met.
Print the receipt for the transaction.
Eject the ATM card.
End the transaction.
true false are computer has four main parts
Answer:
It is true because computer have four main parts
3. Consider the organization you are currently working in and explain this organization from systems characteristics perspectives particularly consider objective, components (at least three) and interrelationships among these components with specific examples.
The organization i worked for from systems characteristics perspectives is based on
Sales and OperationsMarketing and Customer RelationsWhat is the systems characteristics perspectivesIn terms of Sales and Operations: This part involves tasks connected to managing inventory, moving goods, organizing transportation, and selling products. This means getting things, storing them, sending them out, and bringing them to people.
Lastly In terms of Marketing and Customer Relations: This part is all about finding and keeping customers by making plans for how to sell products or services.
Read more about systems characteristics perspectives here:
https://brainly.com/question/24522060
#SPJ1
MyPltw 1.2.2 Hack Attack.
I need help on getting the PasswordNumberGuess label to show the numbers that are being tested. (Also for some reason, when I hack, the api says “error incorrect password” but when I retrieve the string it has been reset, why is that?)
To display the numbers being tested in the PasswordNumberGuess label, you can add the following code inside the for loop:
PasswordNumberGuess.Text = i.ToString();
How would this solve your problem?Considering the complication with the password reset, it is conceivable that the API has been configured to reset the password after a certain number of failed endeavors.
One should inspect the API documentation or communicate with the provider of the said service for additional exposure on this trait.
As an additional choice, mayhap there exists an error in your code resulting in unintentionally initiating the exclusion of the password. Consider perusing your program systematically to confirm that you are not automatically restarting the password.
Read more about hack attacks here:
https://brainly.com/question/14366812
#SPJ1
HELP PLEASE ASAP! I don't know what is wrong with my code, it's supposed to output the same given output. C++ program. Please modify my code. Thanks in advance
#include //Input/Output Library
#include //Srand
#include //Time to set random number seed
#include //Math Library
#include //Format Library
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversions/Higher Dimensions - i.e. PI, e, etc...
const float MAXRAND=pow(2,31)-1;
//Function Prototypes
void init(float [],int n);//Initialize the array
void print(float [],int,int);//Print the array
float avgX(float [],int);//Calculate the Average
float stdX(float [],int);//Calculate the standard deviation
//Execution Begins Here!
int main(int argc, char** argv) {
//Set the random number seed
srand(static_cast (time(0)));
//Declare Variables
const int SIZE=20;
float test[SIZE];
//Initialize or input i.e. set variable values
init(test,SIZE);
//Display the outputs
print(test,SIZE,5);
cout<<"The average = "<
cout<<"The standard deviation = "<
//Exit stage right or left!
return 0;
}
void init(float a[],int n){
int i;
for(i=0;i
scanf("%f",&a[i]);
}
}
void print(float arr[],int n,int b){
int i;
for(i=0;i
}
}
float avgX(float arr[],int n){
float sum=0.0;
int i=0;
for(i=0;i
sum=sum+arr[i];
}
return ((float)sum/n);
}
float stdX(float arr[],int n){
float mean=avgX(arr,n);
float sum=0.0;
int i;
for(i=0;i
sum=sum+pow((arr[i]-mean),2);
}
sum=sum/n-1;
return sqrt(sum);
}
Answer:
#include <iostream> // Input/Output Library
#include <cstdlib> // Srand
#include <ctime> // Time to set random number seed
#include <cmath> // Math Library
#include <iomanip> // Format Library
using namespace std;
// Function Prototypes
void init(float[], int); // Initialize the array
void print(float[], int, int); // Print the array
float avgX(float[], int); // Calculate the average
float stdX(float[], int); // Calculate the standard deviation
// Global Constants, no Global Variables are allowed
// Math/Physics/Conversions/Higher Dimensions - i.e. PI, e, etc...
const float MAXRAND = pow(2, 31) - 1;
// Execution Begins Here!
int main(int argc, char** argv) {
// Set the random number seed
srand(static_cast<unsigned>(time(0)));
// Declare Variables
const int SIZE = 20;
float test[SIZE];
// Initialize or input i.e. set variable values
init(test, SIZE);
// Display the outputs
print(test, SIZE, 5);
cout << "The average = " << avgX(test, SIZE) << endl;
cout << "The standard deviation = " << stdX(test, SIZE) << endl;
// Exit stage right or left!
return 0;
}
void init(float a[], int n) {
int i;
for (i = 0; i < n; i++) {
a[i] = static_cast<float>(rand()) / (MAXRAND);
}
}
void print(float arr[], int n, int b) {
int i;
for (i = 0; i < n; i++) {
cout << fixed << setprecision(b) << arr[i] << " ";
if ((i + 1) % 10 == 0) {
cout << endl;
}
}
cout << endl;
}
float avgX(float arr[], int n) {
float sum = 0.0;
int i;
for (i = 0; i < n; i++) {
sum = sum + arr[i];
}
return sum / n;
}
float stdX(float arr[], int n) {
float mean = avgX(arr, n);
float sum = 0.0;
int i;
for (i = 0; i < n; i++) {
sum = sum + pow((arr[i] - mean), 2);
}
sum = sum / (n - 1);
return sqrt(sum);
}
Explanation:
There were 8 key changes made:
Added the missing include statements: <iostream> for input/output, <cstdlib> for srand, <ctime> for time, <cmath> for math functions, and <iomanip> for formattingAdded missing semicolons at the end of the cout statementsFixed the function prototypes and definitions to match their declarationsAdded missing closing angle brackets in srand(static_cast<unsigned>(time(0)));Changed the input prompt in the init function to use cin instead of scanfFixed the print function to display the values in a formatted manner and added line breaks every 10 elementsFixed the division in the stdX function to use (n - 1) instead of n - 1 to calculate the sample varianceAdded missing #include <iomanip> for the setprecision function used in print