The standard settings that control how the screen of a computer is set up and how a document looks when you first start typing is called default settings.
What is a word processing software?A word processing software can be defined as a type of software that is designed and developed so as to enable its end users type, format and save text-based documents such as:
In Computer technology, the standard settings that control how the screen of a computer is set up and how a document looks when you first start typing on a word processing software is called default settings.
Read more on word processing here: brainly.com/question/24043728
#SPJ1
Sandra wants to track product data and uncover patterns in data. She should use a _____. spreadsheet spreadsheet word processor word processor database
Sandra can track product data and uncover patterns in data if She use a database.
How do you find trends and patterns in data?A trend is one that can be seen by setting up a line chart. The trendline is seen or created between a high and a low point.
In the case above, Sandra can track product data and uncover patterns in data if she use a database.
Learn more about patterns in data from
https://brainly.com/question/18892466
#SPJ1
Why is cyber security an important part of sending information using digital signals
Cyber security is an important part of sending information using digital signals. Because it keeps data safe while stored in the cloud and when they are transmitted. Option D is correct.
What are cybersecurity functions?Analysts in cybersecurity defend an organization's hardware and network infrastructure against hackers and cybercriminals looking to harm them or steal confidential data.
When conveying information via digital signals, cyber security is a crucial component. because it protects data as it is sent and stored in the cloud.
Hence, option D is correct.
To learn more about cybersecurity refer;
https://brainly.com/question/27560386
#SPJ1
The more disks that are added to the tower, the more difficult the game becomes. What is the minimum number of moves it would take to move two disks from one peg to the other
The minimum number of moves it would take to move two disks from one peg to the other is first to make 1 move, then 3 moves.
What is the rule used in solving the Tower of Hanoi?
In the rules of this game, It state that just one disk is one that can be moved in case of some towers at any given time.
Note that just the "top" disk is one that can be removed and as such, The minimum number of moves it would take to move two disks from one peg to the other is first to make 1 move, then 3 moves.
Learn more about disks from
https://brainly.com/question/1558359
#SPJ1
write a c program to find area of rectangle using user defined function.
Answer:
// C Program to Find Area of Rectangle
#include <stdio.h>
int main() {
float length, width, area;
printf("Enter the length & width of the rectangle::\n");
scanf("%f", &length);
scanf("%f", &width);
// It will calculate area of rectangle
area = length * width;
// It will print the final output
printf("\nArea of the rectangle is: %f units\n", area);
return 0;
}
Hope This Helps!!!
C++ code only......
Overview:
Synopsis: Type in a word and get a point value. A point value is the sum of the points of the individual letters multiplied by any bonus multipliers (defined later).
In both Words With Friends and the scrabble game, a individual letters in a word are given specific values.
Your program will let me keep typing in words and giving me the point value until I stop the program.
---------------------------------------------------------------------------------------------------------------------------------------------
Basic Point values:
For this lab, calculate the value of a word with the following specific rules:
A, E, I, O, S, U are worth 1 point
D, F, G, L, M, N, R, T are worth 2 points
B, C, K, P, Y are worth 3 points
H, J, Q, V, W, X, Z are worth 5 points.
If the word was CAT, the value would be 3 + 1 + 2 or 6 points.
-------------------------------------------------------------------------------------------
Bonus Point multipliers
DOUBLE: Any word that contains two (or more) of the same letter in a row has it's value doubled. Some examples are 'asset' and 'little'. You can only double things once.
TRIPLE: Any word that has three (or more) 1 point letters has it's value triples. You can only triple a word once. 'asset' has 4 single point letters (a, s, s, and e), while little only has 2 (i and e)
You can both DOUBLE and TRIPLE a word.
--------------------------------------------------------------------------------------------------------------------------------------------
Dictionary Lookup
You also need to check to see if the word is in a dictionary. There's one at
http://www.csit.parkland.edu/~kurban/permanent/lists/ and it's called web2.txt
It contains one word per line and is already sorted. You can make your own smaller dictionary to test it if you like.
Please do not turn in the dictionary.
-----------------------------------------------------------------------------------------------------------------------
Requirements
Your program will ask the user for a word (without spaces) and print it's value.
Ignore any special characters or numbers that are entered. [I won't include these in my test cases].
If the word isn't in the dictionary, report that the word isn't a valid word.
You HAVE to use my rules or you will receive 0 credit!
----------------------------------------------------------------------------------------------------------
Examples:
asset = (1 + 1 + 1 + 1 + 2) * 2 * 3 = 18 (double letters, 3 single point letters)
little = (2 + 1 + 2 + 2 + 2 + 1) * 2 = 24 (double letters)
abacadabra = (1 + 3 + 1 + 3 + 1 + 2 + 1 + 3 + 2 + 1) * 3 = 56 (3 single point letters)
football = (2 + 1 + 1 + 2 + 3 + 1 + 2 + 2) * 2 * 3= 84 (double letters only double once, 3 single point letters)
Using the computational language C++ it is possible to write a code that adds the values of the letters and does the multiplication as well.
Writting the code in C++:
#include <iostream> //for input/output functions
#include <string> //for C++ style strings
#include <cctype> //for toupper utility function
#include <fstream> //for file I/O
using namespace std;
//function to calculate the score of the given word
int getScore(string word)
{
int score = 0;
int singles = 0;
char c; //variable to hold the current character
char prev='0'; //variable to hold the previous character
//'0' so that prev is not equal to c in the first place
bool doubled = false;
for(int i = 0; i < word.length(); i++)
{
c = toupper(word[i]);
switch(c)
{
case 'A':
case 'E':
case 'I':
case 'O':
case 'S':
case 'U':
score = score+1;
singles++;
break;
case 'D':
case 'F':
case 'G':
case 'L':
case 'M':
case 'N':
case 'R':
case 'T':
score = score+2;
break;
case 'B':
case 'C':
case 'K':
case 'P':
case 'Y':
score = score+3;
break;
case 'H':
case 'J':
case 'Q':
case 'V':
case 'W':
case 'X':
case 'Z':
score = score+5;
break;
}
//if at any point, the previous character is the same as the current character, we double
if(c == prev)
doubled = true;
prev = c;
}
if(doubled) score *= 2;
//if 1 point characters are more than 3, we triple
if(singles >= 3) score *= 3;
return score;
}
//function to check if the given word is in the dictionary
bool inDictionary(string word)
{
//we assume that the dictionary is stored in a file called dictionary.txt
ifstream fin("dictionary.txt");
//check for file errors
if(!fin)
{
cout << "File did not load properly" << endl;
return false;
}
string current;
//read until the file ends
while(!fin.eof())
{
fin >> current;
//we found the word
if(current.compare(word) == 0)
return true;
}
return false;
}
int main(int argc, char const *argv[])
{
string word;
cout << "Please enter the word whose score you want to compute: ";
cin >> word;
cout << "Score is " << getScore(word) << endl;
if(inDictionary(word))
cout << "The given word was found in the dictionary." << endl;
else
cout << "The given word was not found in the dictionary." << endl;
return 0;
}
See more about C++ code at brainly.com/question/17544466
#SPJ1
Kenny works with an IT company. His company is about to launch new software in the market. He has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. Which job profile is Kenny likely to have?
Kenny is likely to have the job profile of a _______.
The job profile that Kenny is likely to have is software analyst.
What is a job profile?This is known to be that which states the details of an employee in regards to their job.
Note that a software analyst is known to be that person who examines and maintain the software development process, carry out configuration management, and others.
So, The job profile that Kenny is likely to have is software analyst.
Learn more about job profile from
https://brainly.com/question/3700565
#SPJ1
For which three everyday activities do people most typically use computers?
Answer:
Explanation:
People use computers to :
1. Communicate
2. Research
3. To better understand different aspects of their domain or just something they want to know.
4. Computers have the power to be obedient and do whatever people want, which makes them very efficient for a lot of tasks.
5. The fact that computers can run complex algorithms at an incredible speed is something that would be impossible for a person.
6. Computers can make people better understand the world.
7. An interesting fact, is that the brain works on electricity just like a computer, but also works like a computer. (imagine the neurons of the brain being bits.)
8. With the help of computers, we discovered more than 60 trillion of Pi's digits.
9. AI is a very powerful concept for computers because they can learn about anything over time, and get better than people at doing real-life tasks, which would make the overall human civilization better.
10. Computers could help us mathematically find Earth-like planets, which will be useful since in billions of years the sun will die.
11. The human robots, which would get one of the best human-made inventions, could simply change the world, into a way more efficient one, and the fact that our brain works just like the computer, makes us more like robots.
But, what if robots take over the world and kill all humans? Is that possible?
Nope. A robot will never kill anyone. Know why? Because robots will always be obedient to the code we write into them. Whatever if write into their chip, they will run(the code) that.
If a robot is coded to not kill anyone and kills someone, it is just like we wouldn't live in real life. No robot can overthink the code we put into them. People just think that robots will overtake control because of films and stories. That will never happen.
That's just how robots work. Humans are robots. But we can do whatever we want because the DNA doesn't program us to not do something. As humans, we can do whatever we think because we are programmed to not have limits in thinking. But, the robots have a limit. That limit is the script written into it.
Computers and AI have just advantages. No one will kill someone.
In _________, the process requests permission to access and modify variables shared with others. A) entry section B) critical section C) exit section D) remainder section
In entry section, the process requests permission to access and modify variables shared with others.
What is Entry section?Entry Section is known to be an aspect of any given process that tells the entry of a specific process.
Note that it often allows one process to enter and alter the shared variable and as such, In entry section, the process requests permission to access and modify variables shared with others.
Learn more about entry section from
https://brainly.com/question/1637572
#SPJ1
Nolan is writing an after action report on a security breach that took place in his organization. The attackers stole thousands of customer records from the organization's database. What cybersecurity principle was most impacted in this breach
The cybersecurity principle was most impacted in this breach is known to be confidentiality.
What is confidentiality?Confidentiality is a term that connote the act of respecting a person's privacy, and not sharing personal or any sensitive information about a person to others.
Note that, The cybersecurity principle was most impacted in this breach is known to be confidentiality.
Learn more about confidentiality from
https://brainly.com/question/863709
#SPJ1
A company's prospectus includes:
A) The company's investment options.
B) The company's guaranteed return strategy.
C) The company's revenue and net worth.
D) The company's research.
A company's prospectus includes: A. The company's investment options.
What is a prospectus?A prospectus can be defined as a legal document that is formally required of companies by and filed with the Securities and Exchange Commission (SEC), so as to provide information about its investment options and offering that are for sale to the public.
This ultimately implies that, a company's prospectus must include information about the company's investment options.
Read more on prospectus here: https://brainly.com/question/27245796
#SPJ1
A security specialist discovers a malicious script on a computer. The script is set to execute if the administrator's account becomes disabled. What type of malware did the specialist discover
The security specialist has discovers a malicious script on a computer known as a logic bomb.
Is logic bomb a type of malware?A logic bomb is known to be a form of a malicious program that is set up or ignited if a logical condition is met, such as after a series of transactions have been done, or on a given date.
Therefore, The security specialist has discovers a malicious script on a computer known as a logic bomb.
Learn more about malware from
https://brainly.com/question/399317
#SPJ1
Answer:
Logic Bomb
Explanation:
Describe two features of a digital audio workstation that can be used to enhance a podcast
The two features of a digital audio workstation that can be used to enhance a podcast are DAW is truly vital in case you need expert sounding song. Or in case you need an unprofessional-sounding song.
What are the blessings of the use of a virtual audio workstation?Digital audio workstations have revolutionized the manner song and audio recordings are made. With surely limitless tune counts, lightning-quick, specific modifying capabilities, plugins, and more, all of us can bounce in and begin recording and mixing.
Regardless of configuration, cutting-edge DAWs have a relevant interface that lets in the consumer to adjust and blend more than one recordings and track right into a very last produced piece. A computer-primarily based totally DAW has a few primary components: a computer, a legitimate card or audio interface, a virtual audio modifying software, and an audio or midi source.Read more about the workstation :
https://brainly.com/question/24540334
#SPJ1
You can use the keyboard/mouse, Insert Function box, and Sum button menu to insert functions in a formula. Which method do you prefer
The preferred method is using the keyboard/mouse to insert functions into formula
How to determine the preferred method?The scenarios are given as:
Insert functions using the keyboard/mouse Insert functions without using the keyboard/mouseUsing the keyboard and the mouse to insert functions would be faster and more efficient, compared to not using the keyboard and the mouse
Hence, the preferred method is using the keyboard/mouse
Read more about keyboard and mouse at:
https://brainly.com/question/1245638?source=archive
#SPJ1
Spectrum Technologies uses SHA 256 to share confidential information. The enterprise reported a breach of confidential data by a threat actor. You are asked to verify the cause of the attack that occurred despite implementing secure cryptography in communication. Which type of attack should you consider first, and why?
The type of attack in the case above that a person need to consider first, is Misconfiguration attack.
Why Misconfiguration attack?Due to the fact that the company need to have configured a higher security hash algorithm instead of using the less-secure SHA 256 and as such the attack occurred.
Therefore, The type of attack in the case above that a person need to consider first, is Misconfiguration attack.
Learn more about Misconfiguration attack from
https://brainly.com/question/15702398
#SPJ1
Make up a python program that can do the following
Write a program to ask the user to input the number of hours a person has worked in a week and the pay rate per hour.
The program to ask the user to input the number of hours a person has worked in a week and the pay rate per hour is as written below.
How to write a Python Program?To write this program, we will pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Thus
hrs = input("Enter Hours:")
h = float(hrs)
xx = input("Enter the Rate:")
x = float(xx)
if h <= 40:
print( h * x)
elif h > 40:
print(40* x + (h-40)*1.5*x)
Read more about Python Program at; https://brainly.com/question/26497128
#SPJ1
What are two advantages for computer programmers of using GitHub as a
collaborative tool when writing code?
A. No additional software installation is needed to view different
types of files.
B. Changes can be integrated into the finished main body of code..
C. Group members can indicate on a schedule when they are
unavailable.
D. Developers can share code online so it can be accessed and
worked on from anywhere.
The two advantages for computer programmers of using GitHub as a collaborative tool when writing code are:
Changes can be integrated into the finished main body of code.Developers can share code online so it can be accessed and worked on from anywhere.What is GitHub advantages?GitHub is known to be a form of a website that is made by developers and programmers to help them together to work on code.
The key benefit of GitHub is mainly version control system that gives room for for seamless collaboration and it is one that does not compromise the integrity of the original project.
So, The two advantages for computer programmers of using GitHub as a collaborative tool when writing code are:
Changes can be integrated into the finished main body of code.Developers can share code online so it can be accessed and worked on from anywhere.Learn more about computer programmers from
https://brainly.com/question/23275071
#SPJ1
Identify the true statements about the approach to privacy around the world. a. Uncertainty concerning the nature, extent, and value of privacy is widespread. b. The United States has the most centralized and consistent approach to personal privacy issues. c. A legal right to privacy as recognized within the United States is acknowledged by all western countries. d. Significant disagreement about privacy exists within the United States.
Answer:
a. Uncertainty concerning the nature, extent, and value of privacy is widespread.
d. Significant disagreement about privacy exists within the United States.
Write a Java program which declares and populates an array with some values (at least 5 values). Then it should call a method passing it the array. The method should modify the array values using a loop. Lastly, after the program calls the method, it should display the modified array contents to the console.
Answer:
CODE IN JAVA :
import java.util.*;
public class Main
{
public static void modifyArray(int[] arr, int n){
for(int i = 0; i < n; i++){
arr[i] = -1; // each value is modified to -1
}
}
public static void main(String[] args) {
int n;
System.out.print("Enter size of array(atleast 5): ");
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
int array[] = new int[n]; // array with size n declared
// populating the array
System.out.print("Enter array elements: ");
for(int i = 0; i < n; i++){
array[i] = sc.nextInt();
}
// modifying array via a function
modifyArray(array, n);
// printing array values after modifiction
System.out.print("Array after modification: ");
for(int i = 0; i < n; i++){
System.out.print(array[i] + " "); // space separated
}
}
}
Explanation:
A value that is used in a computation is known as an _____. Group of answer choices operand operator function clause
A value that is used in a computation is known as an operand .
What is an operand value?This is seen in assembly language as it is defined as a value or an argument via through which the instruction is said to operate.
Note therefore that A value that is used in a computation is known as an operand.
Learn more about operand from
https://brainly.com/question/6381857
#SPJ1
Given class triangle (in files triangle.h and triangle.cpp), complete main() to read and set the base and height of triangle1 and of triangle2, determine which triangle's area is larger, and output that triangle's info, making use of triangle's relevant member functions.
ex: if the input is:
3.0 4.0
4.0 5.0
where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is:
triangle with larger area:
base: 4.00
height: 5.00
area: 10.00
given (in main.cpp):
#include
#include "triangle.h"
using namespace std;
int main(int argc, const char* argv[]) {
triangle triangle1;
triangle triangle2;
// todo: read and set base and height for triangle1 (use setbase() and setheight())
// todo: read and set base and height for triangle2 (use setbase() and setheight())
// todo: determine larger triangle (use getarea())
cout << "triangle with larger area:" << endl;
// todo: output larger triangle's info (use printinfo())
return 0;
}
The C++ program that would complete the main () and set the base and height of triangle1 and of triangle2 is:
main.cpp
#include <iostream>
#include "Triangle.h"
using namespace std;
int main()
{
Triangle Tri1;
Triangle Tri2;
double base1, height1, base2, height2;
cout << "Enter a base for your Triangle1: ";
cin >> base1;
cout << "Enter a height for your Triangle1: ";
cin >> height1;
cout << endl;
cout << "Enter a base for your Triangle2: ";
cin >> base2;
cout << "Enter a height for your Triangle2: ";
cin >> height2;
cout << endl;
cout << "################################" << endl;
cout << "Triangle with larger area:" << endl;
if ((0.5)*base1*height1 > (0.5)*base2*height2){
Tri1.setValues(base1, height1);
Tri1.getValues();
cout << "Area: " << Tri1.getArea() << endl << endl;
}
else{
Tri2.setValues(base2, height2);
Tri2.getValues();
cout << "Area: " << Tri2.getArea() << endl;
}
return 0;
}
Read more about C++ programs here:
https://brainly.com/question/20339175
#SPJ1
g A user receives an email from an unknown source with a link to a website asking for their password. The userenters in their password, but nothing happens. What is the user a victim of
Based on the information provided, this user is a victim of phishing.
What is phishing?Phishing can be defined as a type of cyberattack which involves making an attempt to obtain sensitive user information such as a password, especially by disguising as a trustworthy entity in an electronic communication (email), which is usually over the Internet.
In this context, we can infer and logically deduce that this user is a victim of phishing because he or she received an email from an unknown source with a link to a website asking for their password.
Read more on phishing here: https://brainly.com/question/23850673
#SPJ1
Rob is planning his housewarming party. He wants to design an invitation and personalize it for each invitee. He needs to create a list of invitees, design the card, and personalize the card. How should he complete the tasks
As Ben is personalizing the card, the wat he can complete the tasks is that he should use a word processor for step 1, graphics software for step 2, and a mail merge for step 3.
What is a word processor?A word processor is known to be a program that helps to work or processes words. They are Microsoft Word, WordPerfect (Windows only), etc.
Note that, As Ben is personalizing the card, the wat he can complete the tasks is that he should use a word processor for step 1, graphics software for step 2, and a mail merge for step 3.
See options below
Rob is planning his housewarming party. He wants to design an invitation and personalize it for each invitee. These are the things he needs to do:Create a list of invitees;Design the card; andPersonalize the card.How should he go about the task?
A. Use a word processor for step 1, graphics software for step 2, and a mail merge for step 3.
B. Use a graphics software for step 1, mail merge for step 2, and a word processor for step 3.
C. Use a word processor for steps 1 and 2 and a graphics software for step 3.
D. Use mail merge for steps 1 and 2 and a word processor for step 3.
Learn more about design from
https://brainly.com/question/1212088
#SPJ1
Rob should use a word processor for step 1, a graphics software for step 2, and a mail merge for step 3.
What is a word processor?A word processor is a word-processing software program that is designed and developed to avail its end users an ability to type, format, adjust and save text-based documents.
In this scenario, Rob should use a word processor to create a list of invitees, a graphics software to design the card, and lastly, a mail merge to personalize the card.
Read more on word processor here: https://brainly.com/question/25813601
#SPJ1
In addition to a specified pattern of characters, all legitimate credit card numbers must satisfy the Luhn Algorithm also known as the _____. Damm Algorithm Mod10 Algorithm Euclid's Algorithm Verhoeff Algorithm
2. How can Tailwind Traders ensure applications use geo-redundancy to create highly available storage applications?
Tailwind Traders CAN ensure applications use geo-redundancy to create highly available storage applications by:
Running one's application in read-only mode.Enforcing its use.What is geo redundant storage?Geo-redundant storage (GRS) is known to be a device that tends to copy one's data synchronously three times in the same or inside a single physical location in the primary region via the use of LRS.
Note that in the case above, Tailwind Traders CAN ensure applications use geo-redundancy to create highly available storage applications by:
Running one's application in read-only mode.Enforcing its use.Learn more about Geo-redundant storage from
https://brainly.in/question/6073238
#SPJ1
An accenture technology team located in the us has added a new feature to an existing online ticketing platform. the team would like to have the new feature reviewed by other global teams using individual instances of the platform. which technology, when combined with agile and devops, will help the team receive real-time feedback?
The technology, when combined with agile and devops, will help the team receive real-time feedback is artificial intelligence (ai).
What is AI artificial intelligence?Artificial intelligence is known to be a form of simulation that regards to human intelligence acts by machines, mostly computer systems.
Note that in the above case, The technology, when combined with agile and devops, will help the team receive real-time feedback is artificial intelligence (ai).
See options below
intelligent apps
artificial intelligence (ai)
internet of things (lot)
cloud computing
I don't know this yet.
Learn more about Accenture technology from
https://brainly.com/question/25682883
#SPJ1
Given the doubt and uncertainty of a relational exchange, what is necessary to ensure the customer's ongoing commitment to the Spero brand?
The factor that is necessary to ensure the customer's ongoing commitment to the Spero brand is that:
Know your Customer Expectations.Study your Customer types and Journeys.Examine How Brand Perception Has been altered Over Time, etc.How do one show commitment to customers?This can be done by:
Giving your customer relevant and valuable content/brand.Form a customer community.Share success stories linked to the brand.Therefore, The factor that is necessary to ensure the customer's ongoing commitment to the Spero brand is that:
Know your Customer Expectations.Study your Customer types and Journeys.Examine How Brand Perception Has been altered Over Time, etc.Learn more about brand from
https://brainly.com/question/25689052
#SPJ1
Which load balancing method is not supported in equal cost multipath (ECMP) load balancing, but is supported in SD-WAN
The load balancing method that is not supported in equal cost multipath (ECMP) load balancing, but is supported in SD-WAN is Volume load balancing.
What is load balancing?Load balancing is known to be one that shares server loads in all of multiple resources and also in all multiple servers.
Note that this method technique often works to reduce response time, and as such, The load balancing method that is not supported in equal cost multipath (ECMP) load balancing, but is supported in SD-WAN is Volume load balancing.
Learn more about load balancing from
https://brainly.com/question/13088821
#SPJ1
Kim likes what you have offered and agrees. After consulting with your supervisor, you get the equipment from the trunk and begin working. Kim approaches you as you are installing the modem and is a little concerned about customers being on the same network. Kim is afraid that customers will be able to "read" the information from credit cards and sales registers.
a. offer Kim a VPN setup that will secure all network traffic.
b. Offer Kim a hardware firewall and section off the network to prevent customers from being able to read network traffic.
The VPN setup are:
The use of VPN via your router or
The first step is to make a VPN profile and one need to fill their details from your VPN service.Then use the Windows button by clicking it and then go to Settings > Network & Internet > VPN. select on Add a VPN connection and follow the steps.Why use VPN?
A VPN is one that set up a secure, encrypted link between your device and a private server, and it is one that hides your traffic from being seen.
Therefore, The VPN setup are:
The use of VPN via your router or
The first step is to make a VPN profile and one need to fill their details from your VPN service.Then use the Windows button by clicking it and then go to Settings > Network & Internet > VPN. select on Add a VPN connection and follow the steps.Learn more about VPN setup from
https://brainly.com/question/25554117
#SPJ1
Word frequencies - functions
Define a function named GetWordFrequency that takes a vector of strings and a search word as parameters. Function GetWordFrequency() then returns the number of occurrences of the search word in the vector parameter (case insensitive).
Then, write a main program that reads a list of words into a vector, calls function GetWordFrequency() repeatedly, and outputs the words in the vector with their frequencies. The input begins with an integer indicating the number of words that follow.
Ex: If the input is:
5 hey Hi Mark hi mark
the output is:
hey 1
Hi 2
Mark 2
hi 2
mark 2
Hint: Use tolower() to set the first letter of each word to lowercase before comparing.
The program must define and use the following function:
int GetWordFrequency(vector wordsList, string currWord)
#include
#include
#include
#include
using namespace std;
/* Define your function here */
int main() {
/* Type your code here */
return 0;
}
Answer:
#include <iostream>
#include <vector>
#include <iomanip>
#include <string.h>
#include <string>
#include <algorithm>
using namespace std;
bool strEqual(const string& str1, const string& str2)
{
//check each characters by case insensitive
return std::equal(str1.begin(), str1.end(),
str2.begin(), str2.end(),
[](char str1, char str2) {
return tolower(str1) == tolower(str2);
});
}
unsigned GetWordFrequency(vector<string>& vec,const string& str)
{
//return the number of occurrences of the search word in the
unsigned res=0;//the numbers of occurences
for(auto itr:vec)
{
if(strEqual(itr,str))
res++;
}
return res;
}
int main()
{
int size=0;
cin>>size;
vector<string>vec;
for(int i=0;i<size;i++)
{
string str;
cin>>str;
vec.push_back(str);
}
cout<<"Output:"<<endl;
for(auto itr: vec)
{
cout<<itr<<" - "<<GetWordFrequency(vec,itr)<<endl;
}
return 0;
}
Explanation:
Which computer use microprocessor as its CPU ?
Microcomputer was formerly a commonly used term for personal computers, particularly any of a class of small digital computers whose CPU is contained on a single integrated semiconductor chip. Thus, a microcomputer uses a single microprocessor for its CPU, which performs all logic and arithmetic operations.