Hello, I am having trouble adding a txt file into a array, so I can pop it off for a postfix problem I have uploaded what I have so far. I need help please

Answers

Answer 1

Answer:

#include <stack>

#include<iostream>

#include<fstream> // to read imformation from files

#include<string>

using namespace std;

int main() {

   stack<string> data;

   ifstream inFile("postfix.txt");

   string content;

   if (!inFile) {

       cout << "Unable to open file" << endl;

       exit(1); // terminate with error

   }

   while (getline(inFile, content)) {

       data.push(content);

   }

   inFile.close();

   return 0;

}

Explanation:

You were very close. Use the standard <stack> STL library, and make sure the stack elements are of the same type as what you're trying to add, i.e., std::string.


Related Questions

5.15 LAB: Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding spaces, periods, or commas. Ex: If the input is:

Answers

Answer:

Following are the code to this question:

userVal = input()#defining a variable userVal for input the value

x= 0#defining variable x that holds a value 0

for j in userVal:#defining for loop to count input value in number

   if not(j in " .,"):#defining if block that checks there is no spaces,periods,and commas in the value

       x += 1#increment the value of x by 1

print(x)#Print x variable value

Output:

Hello, My name is Alex.

17

Explanation:

In the above-given code, a variable "userVal" is defined that uses the input method for input the value from the user end, in the next line, an integer  variable "x" is defined, hold value, that is 0, in this variable, we count all values.

In the next line, for loop is defined that counts string value in number and inside the loop an if block is defined, that uses the not method to remove spaces, periods, and commas from the value and increment the value of x by 1. In the last step, the print method is used, which prints the calculated value of the "x" variable.    

 

Answer:

Explanation:#include <iostream>

#include<string>

using namespace std;

int main()

{

  string str;

   

cout<<"Enter String \n";

 

getline(cin,str);/* getLine() function get the complete lines, however, if you are getting string without this function, you may lose date after space*/

 

  //cin>>str;

 

  int count = 0;// count the number of characeter

  for (int i = 1; i <= str.size(); i++)//go through one by one character

  {

     

   

   if ((str[i]!=32)&&(str[i]!=44)&&(str[i]!=46))//do not count  period, comma or space

{

          ++ count;//count the number of character

      }

  }

  cout << "Number of characters are  = "; //display

cout << count;// total number of character in string.

  return 0;

}

}

Which of the following is designed to help an organization continue to operate during and after a disruption?
a. incident response plan
b. business continuity plan
c. disaster recovery plan
d. risk mitigation plan

Answers

Answer:

d

Explanation:

cause people need a care for there incedents that not expected thats why people need help prevent from a risk to save people lives


A high school in a low-income area offers special programs to help students acquire the technical skills needed to find jobs as computer technicians
This program is most strongly related to which aspect of life?

Answers

Answer:

Economy

Explanation:

Education geared towards readying students to become an employable technician or becoming skilled in a particular craft are known as vocational education. Vocational education, otherwise known as career and technical education is provided by a vocational school

It is suggested that there should be wider range of educational coverage between higher education and vocational educational due to the increasing importance of the use of technology in the workplace

As such technical vocational education is generally taken as an important tool to grow the economy while particularly reducing the unemployment among the youth.

When the code that follows is executed, a message is displayed if the value the user entersvar userEntry = (prompt("Enter cost:");if (isNaN(userEntry) || userEntry > 500 ) { alert ("Message");a. isn’t a number or the value in userEntry is more than 500b. isn’t a number and the value in userEntry is more than 500c. is a number or the value in userEntry is more than 500d. is a number and the value in userEntry is more than 500

Answers

Answer:

The answer is "Option b".

Explanation:

In the given-code variable "userEntry" is defined that prompt the user to input value and in the next step, the conditional statement is used, which checks the input value is not a number and greater than 500 with use of OR operator. if the condition is true it uses the alert box to print the message, that's why in this question except "choice b" all were wrong.

Declare a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for the given program:Patient data: 63 in, 115 lbs#include using namespace std;/* Your solution goes here */int main() {PatientData lunaLovegood;lunaLovegood.heightInches = 63;lunaLovegood.weightPounds = 115;cout << "Patient data: "<< lunaLovegood.heightInches << " in, "<< lunaLovegood.weightPounds << " lbs" << endl;return 0;}

Answers

Answer:

struct PatientData{

   int heightInches, weightPounds;

};

Explanation:

In order to declare the required struct in the question, you need to type the keyword struct, then the name of the struct - PatientData, opening curly brace, data members - int heightInches, weightPounds;, closing curly brace and a semicolon at the end.

Note that since the object - lunaLovegood, is declared in the main function, we do not need to declare it in the struct. However, if it was not declared in the main, then we would need to write lunaLovegood between the closing curly brace and the semicolon.

If a schema is not given, you may assume a table structure that makes sense in the context of the question. (using sql queries)
Find all Employee records containing the word "Joe", regardless of whether it was stored as JOE, Joe, or joe.

Answers

Answer:

The correct query is;

select * from EMPLOYEE where Employee_Name = 'JOE' or Employee_Name = 'Joe' or Employee_Name = 'joe';

where EMPLOYEE refer to the table name and type attribute name is Employee_Name

Explanation:

Here, the first thing we will do is to assume the name of the table.

Let’s assume the table name is EMPLOYEE, where the column i.e attribute from which we will be extracting our information is Employee_Name

The correct query to get the piece of information we are looking for will be;

select * from EMPLOYEE where Employee_Name = 'JOE' or Employee_Name = 'Joe' or Employee_Name = 'joe';

Which of the following statements is correct? Group of answer choices An object of type Employee can call the setProjectName method on itself. The Employee class's setDepartment method overrides the Programmer class's setDepartment method. An object of type Programmer can call the setDepartment method of the Employee class on itself. An object of type Employee can call the setDepartment method of the Programmer class on itself.

Answers

Answer:

An object of type Employee can call the setDepartment method of the Programmer class on itself

Explanation:

From what can be inferred above, the programmer class is a subclass of the employee class meaning that the programmer class inherits from the employee class by the code:

Public class Programmer extends Employee

This therefore means(such as in Java) that the programmer class now has access to the methods and attributes of the employee class, the superclass which was inherited from

A professor copies one article from a periodical for distribution to the
class. Is that Fair Use? *

Yes or No?

Answers

Yess I think I’m not sure

Answer:

no because...

Explanation:

proffesers say you can't copy so why would they copy and also proffesers have degrees they can co.e up with their own questions to help you students to learn more

What are the constraints for designing small and large files and how these are resolved in different file system

Answers

Answer:

space management and buffering speed.

Explanation:

There are different types of file management systems in a computer system, examples of which are NTFS, FAT, WAFL, etc, and are governed by protocols like NFS, TFTP, FTP, etc.

These file systems are used in storages like the hard disk drive, CD and DVD, solid-state drive, etc, to organize or manage the files from boot setup, device drivers to permission-seasoned user files.

Files in storage range from small to large files, for which the schema of the file system must adjust to manage and allocate free space to other files in the future. The file system is also able to index the location of a file for retrieval to a cache memory, making buffering faster.

1a) Skills are increasingly the key variable of the entire process of access and information inequality in the information society. Discuss the 21st century competencies or skills required in the information society and four ways (4) you can apply it during Supported Teaching on Schools.​

Answers

Answer:

Explanation:

Skill acquisition improves quality, competence and competitiveness of an individual, It boost the chances of success and ability to make an impact. Access to information plays a verybhuge role in the society as it enables hearers to get updated while those who aren't informed are left behind. Some of the key competences or skills required in the information society include:

Critical thinking : Problem identification and ways to solve them.

Information sourcing and gathering : knowing where to get vital informations and facts

Effective communication, creativity, leadership, social, media and technological skills and so on.

The skills could be can be applied on schools in the form of :

Creating clubs such as the writing and debate clubs where students are given a research topic to write and present, this improves their research ability and communication skill.

Group project or assignment improves collaboration between members.

Assignments or projects requiring technology : Students may be given problems to solve with the use of computers moutwr programs and technology, this will help mad improve productivity.

Reward for innovation: Students should be paused mad encouraged for being creative, this will improve such individual and push others as well.

which approach does procedural programming follow? bottom up, top down, random, or object oriented​

Answers

Answer:

Top to down approach

Explanation:

3. Explain why the process of project planning is iterative and
why a plan must be continually reviewed during a software
project.
Ans:​

Answers

Answer:

because they inspecting or checking how there works good or not good there are under there work what a result cause they want a good and beautiful work

They're inspecting or checking how there works good or not good there are beneath there job what a result because they want a nice and beautiful work.

What is project planning?

The discipline of project planning focuses on how to complete a project within a predetermined timeframe, often with predetermined stages and resources. According to one method of project planning, the first stage is to set definable goals. scheduling the deliverables definition.

A project plan is made in order to effectively provide a result for the internal or external client. Project deliverables include, for instance, software products, design documentation, and other assets listed in the project plan. Deliverables for projects are frequently asked for as software products.

A project plan is a group of official documents that describe the execution and control phases of the project. The strategy considers risk management, resource management, and communications in addition to scope, cost, and schedule baselines.

Thus, They're inspecting or checking how there works good or not good.

For more information about project planning, click here:

https://brainly.com/question/27992266

#SPJ2

A TCP entity opens a connection and uses slow start. Approximately how many round-trip times are required before TCP can send N segments

Answers

Answer:

Round trip times required =  log2N

Explanation:

The round-trip times required before TCP can send N segments using a slow start is log2N. we can arrive at this by looking at the mode of operation of TCP which is  at the 1st time of using a TCP it starts the congestion window as 1 then it  sends an initial segment. When the acknowledgement of the initial segment arrives, TCP increases the congestion window to 2 and then sends 2 segments, When the 2 acknowledgements of the segments sent out arrives, they each increase the congestion window by one, thereby increasing the congestion window to 4 . therefore it takes   log2N round trips before TCP can send N segments

As described in class, what does the sender send to the receiver when using hashing for integrity and authentication? (Do not include information previously shared / agreed upon by the sender and receiver.)

Answers

Answer:

The answer is "secret key k".

Explanation:

When the sender sends the message, he/she may combine, it with the hidden key, and determines the hashing, when transmitting the information the digest is being sent, and also the message is transmitted through the connection.

when the receiver receives the message, still having the very same secret key, adding the Hidden Key then recalculating the hashing again. In this, two factors if another subsequent digest matches something, this message is sent.  

During transit, the message was certainly not changed. Anybody with the private key – preferably even a preferred sender sent out this letter.

Access controls are enforced automatically in FMS service routines that access and manipulate files and directories.
a True
b. False

Answers

Answer:

A. True

Explanation:

In FMS service routines, access controls are enforced automatically

and they that access and manipulate files and directories. Files and directories are usually accessed via access controls in most of the FMSs.

Additional processing overhead are usually imposed by FMS. Also, the FMS tend to restrict and hinder one from accessing secondary storage.

What is Processor to Memory Mismatch problem?

Answers

direct-mapped cache;
fully associative cache;
N-way-set-associative cache.
That is all I could find sorry I can’t help

You are required to install a printer on a Windows 7 Professional x86 workstation. Which print driver do you need to complete the installation?

Answers

Answer:

It depends on the model of the printer you want to install. Recent printers when connected to the computer install themselves searching for the drivers needed on the internet. Anyway, you can always google the word "driver" plus the model of your printer and it will surely appear the driver you need from the the company's website of the printer

The print driver that you will need to complete the installation of a printer on Windows 7 Professional x86 workstation is; 32 bit driver

In windows 7 Professional, an x86 name architecture simply denotes a 32 - bit CPU and operating system while x64 will refer to a 64-bit CPU and operating system.

Thus, since we want to install a printer on a Windows 7 Professional x86 workstation, it means we have to use a print driver that is 32 - bit.

Read more about 32 bits at; https://brainly.com/question/19667078

Does clicking ads and pop ups like the one shown in this image could expose your computer to malware?

Answers

Answer: Yes, clicking adds/popups like the one in the image could cause your computer/electronic to catch viruses/malware.

Explanation: The cause to this is when you click an ad/popup you're exposing yourself to a potential dangerous/visious site. You're unaware to where the popup could bring you, and for all we know it could bring us to a fake site for a download which is really a visious malware to be downloaded to your device.

Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz have CPIs of 1, 2, 3, and 3 for each class, respectively. P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2 for each class, respectively. Given a program with a dynamic instruction count of 1,000,000 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D.which implementation is faster?
a. What is the global CPI for each implementation?
b. Find the clock cycles required in both cases.

Answers

Answer: Find answers in the attachments

Explanation:

what level of security access should a computer user have to do their job?

Answers

Answer:

A computer user should only have as much access as required to do their job.

Explanation:

A computer user should not be able to access resources outside of their job requirement, as this poses a potential attack vector for an insider threat.  By limiting the scope of resources to just what is needed for the user's specific job, the threat to the system or company can be mitigated with additional access control features for the computer user.  Never allow permission higher than what are needed to accomplish the task.

Cheers.

Maintaining public libraries is a waste of money since computer technology can replace their functions. Do you agree or disagree?

Answers

Answer:

I totally do not agree that maintaining public library is a waste of money

Explanation:

Most library are now advancing in terms of service delivery and public

libraries are no exception as libraries are now incorporating E- platforms/E- libraries, Audio visuals, where anyone can learn or borrow materials electronically.

         Furthermore, not everyone can own a computer set to so that public libraries are even relevant to the majorities who can afford a computer set.

Also a library especially the public library is a place where people can meet and socialize to the end we even make friends at the public library more effectively than the online library can make(if they can).

In summary the pros of physical public libraries can not be over emphasized.

 

System stored procedures a. perform standard tasks on the current database b. are stored in the Master database c. can change with each version of SQL Server d. all of the above

Answers

Answer:

D. all of the above

Explanation:

A Stored Procedure (sp) is an already compiled group of SQL requests that contains either one or more statements which are stored in the master database.

A Stored Procedure can be created by using the CREATE PROC statement.

They perform standard tasks, stored in the master database and can change with each new version of SQL, so option D is correct.

In the design phase of the systems development life cycle (SDLC), the _____ design is an overview of the system and does not include hardware or software choices. Group of answer choices

Answers

Answer:

"Conceptual" is the correct answer.

Explanation:

SDLC would be a particular implementation of a software administration that defines the processes responsible for the creation of such an organization or project, through preliminary feasibility studies to accomplished program activities.The conceptual design seems to be the very first phase of the cycle of brand management, using designs as well as other diagrams or models. It offers an implementation of the study product as a result of a collection of interconnected values and principles about what it will do, function, and look in a user-friendly way.

I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot convert ‘__gnu_cxx::__alloc_traits > >::value_type {aka std::basic_string }’ to ‘char’ for argument ‘1’ to ‘int isOperand(char)’ if(isOperand(expr.at(g))){ ^ postfix.cpp:96:1: warning: control reaches end of non-void function [-Wreturn-type] } I am not sure what I am doing wrong, help please

Answers

Answer:

expr.at(g) returns a string, not a char. They are not the same thing and that is what the compiler is complaining about.

Which of the following statements are true about the growth of technology? Select 3 options.
- The Number of devices connected to the internet of things is expected to triple between 2018 and 2023
- The general public began connecting to the internet when the World Wide Web was introduced in 1991
- Individuals in the United States currently own an average of three connected devices.
- By 1995, almost half of the world’s population was connected to the Internet
- Currently, 67% of people on earth use at least one mobile device

Answers

Answer:

1. Currently, 67% of people on earth use at least one mobile device.

2. The general public began connecting to the Internet when the World Wide    Web was introduced in 1991.

3. By 1995, almost half of the world’s population was connected to the Internet.

Explanation:

I just took the test ;)

Answer:

The correct answer :

-The general public began connecting to the Internet when the World Wide Web was introduced in 1991.

-The number of devices connected to the Internet of Things is expected to triple between 2018 and 2023.

-Currently, 67% of people on earth use at least one mobile device.

( not, By 1995, almost half of the world’s population was connected to the Internet. )

Explanation:

edge 2022

3. What are the first steps that you should take if you are unable to get onto the Internet? (1 point)
O Check your router connections then restart your router.
O Plug the CPU to a power source and reboot the computer.
O Adjust the display properties and check the resolution
Use the Control Panel to adjust the router settings.​

Answers

Answer:

Check your router connections then restart your router.

Explanation:

When the internet connection is not displaying properly then the first step is to check the router. The network icon on the internet displays the availability of internet. Adjust the router and see if the router is working properly. If not restart the router so that it adjusts its settings to default. The connection will be available on the computer and internet will start working normally.

To ensure AD RMS network transmission is protected from being read and interpreted by protocol analyzers, which of the following must be allowed to enroll for a computer certificate?
a) File Server
b) Domain Controller
c) SQL Server
d) Internet Information Services (IIS)

Answers

Answer:

b) Domain Controller

Explanation:

Active Directory Rights Management Services (AD RMS) is a server software that is developed by Microsoft to manage information rights on the Windows server.

The AD RMS servers produce a rights account certificate to link various users with particular PC systems. They also issue end-user licenses.

To ensure that AD RMS network transmission is protected, the domain controller needs to be allowed to enroll for a computer certificate.

A domain controller is a server that authenticates requests from users on a  particular computer network. It keeps user data organized and secure.

Consider the following Stack operations:

push(d), push(h), pop(), push(f), push(s), pop(), pop(), push(m).

Assume the stack is initially empty, what is the sequence of popped values, and what is the final state of the stack? (Identify which end is the top of the stack.)

Answers

Answer:

Sequence of popped values: h,s,f.

State of stack (from top to bottom): m, d

Explanation:

Assuming that stack is  initially empty. Suppose that p contains the popped values. The state of the stack is where the top and bottom are pointing to in the stack. The top of the stack is that end of the stack where the new value is entered and existing values is removed. The sequence works as following:

push(d) -> enters d to the Stack

Stack:  

d ->top

push(h) -> enters h to the Stack

Stack:

h ->top

d ->bottom

pop() -> removes h from the Stack:

Stack:

d ->top

p: Suppose p contains popped values so first popped value entered to p is h

p = h

push(f) -> enters f to the Stack

Stack:

f ->top

d ->bottom

push(s) -> enters s to the Stack

Stack:

s ->top

f

d ->bottom

pop() -> removes s from the Stack:

Stack:

f ->top

d -> bottom

p = h, s

pop() -> removes f from the Stack:

Stack:

d ->top

p = h, s, f

push(m) -> enters m to the Stack:

Stack:

m ->top

d ->bottom

So looking at p the sequence of popped values is:

h, s, f

the final state of the stack:

m, d

end that is the top of the stack:

m

The web development team is having difficulty connecting by ssh to your local web server, and you notice the proper rule is missing from the firewall. What port number would you open on your webserver?

a. Port 21
b. Port 22
c .Port 25
d. Port 80
e. Port 443

Answers

Answer:

Option b (Port 22) seems to the appropriate choice.

Explanation:

Below seem to be some measure you should take to correct this mistake.

Verify whether Droplet's host IP address seems to be right.  Verify existing connection supports communication over all the utilized SSH port. Any access points can be able to block port 22 and sometimes customized SSH. For illustration, you could do this by checking different hosts who used the same port, using only a recognized working SSH connection. These could help you identify unless the current problem is not particular to clients' Droplet. Authenticate the Droplet configuration settings. Verify that they're not being configured to DROP 's preferred policy, and do not apply the port to require connectivity.

The SSH server also operates on port 22, by default.  

Other choices don't apply to the specified scenario. So that the argument presented above will be appropriate.

The port number would you open on your webserver is Port 22

For better understanding let's explain SSH means.

Service Name and Transport Protocol Port Number Registry. where the service name is Secure Shell (SSH) Protocol and it has the port number of 22 therefore this mean that SSH will only work with port 22 using it for other port will only result in difficulty in connection. SSH has other names like Secure Shell or Secure Socket Shell. it is known as a network protocol that helps its users with system administrator.

From the above we can therefore say that the answer The port number would you open on your webserver is Port 22, is correct

Learn more about SSH and port from:

https://brainly.com/question/13054022

Describe and compare imperative (C), functional (SML) and logic (Prolog) programming paradigms.

Answers

Answer:

Answered below

Explanation:

Imperative programming paradigm is a paradigm in which the programmer tells the machine how to change its state. It is divided into procedural programming, where programs are grouped as procedures, and object-oriented, where programs are grouped together with the properties they operate on.

Imperative paradigm is efficient, familiar and popular compared to others.

Functional programming paradigm implements all instructions as functions, in a mathematical sense. They take on an argument and return a single solution. The advantage of this, compared to other paradigms, is its abstraction and independence.

Logical programming, like functional programming, incorporates a declarative approach to problem solving. All known facts are first established before queries are made. Advantage of this paradigm is that programming steps are kept to a minimum.

Other Questions
How many wives did Henry VIII end up marrying?? and who were they?? Question 7 of 10 How much should you save each year for maintenance on your home? $500 Whatever your home inspector recommends 7% of your gross income At least 1% of the purchase price Which of the following is an extended definition of petulant?A Petulant behavior, such as sulking when you don't get your way, is childish and rude.B Danny was a petulant child, unlike his older brother who was always cheerful. His rude behavior was usually vocal,ranging from whining to snide remarks to full-out tantrums. Sometimes though, he simply pouted and turned red in theface. Regardless of how he expressed it, his petulant attitude made almost every family gathering stressful.C petulant (adjective): irritable and impatient; immature rudenessD Synonyms of petulant include irritable, sulky, peevish, and cranky. The average score of all golfers for a particular course has a mean of 70and a standard deviation of 5.Suppose 100golfers played the course today. Find the probability that the average score of the 100golfers exceeded 71.Round to four decimal places. If the effective annual rate of interest is known to be 16.08% on a debt that has quarterly payments, what is the annual percentage rate? Given the following hypotheses: H0: = 490 H1: 490 A random sample of 15 observations is selected from a normal population. The sample mean was 495 and the sample standard deviation 9. Using the 0.01 significance level: a.) State the decision rule. b.) Compute the value of the test statistic. c.) What is your decision regarding the null hypothesis? Simplify 4 to the 2nd power times 4 to the eighth power A. 4 to the 16th power B. 4 to the 10 power C. 16 to the 16 power D. 16 to the 10 power Please help ASAP!!!!!!!! A blue die and a red die are thrown. B is the event that the blue comes up with a 6. E is the event that both dice come up even. Write the sizes of the sets |E B| and |B|a. |E B| = ___b. |B| = ____ A difficulty in understanding the Colombian exchange is that: A. It is unknown which things we first found in which areas. B. Things once unknown now seem like they have always been a part of many cultures C. It is not possible to find out which things were exchanged on purpose or by accident D. Things once I know have different names in different cultures L-Lcos=v^2/2 solve for L Determine the length of chord BC. 1) 17.45 2) 30.96 3) 67.06 4) 33.53 Joseph contributed $25,000 in cash and equipment with a tax basis of $6,400 and a fair market value of $12,600 to Berry Hill Partnership in exchange for a partnership interest. a. What is Josephs tax basis in his partnership interest? b. What is Berry Hills basis in the equipment? Mi hermana y yo siempre ramos muy chistosos.Recuerdo que Paco era chismoso.Mis primos eran muy juguetones.A Leonor le gustaba estar sola. Era una muchacha solitaria.Mi ta Mariana era cariosa.Pls help fast On the graph of voltage versus current, which line represents a 2.0 resistor? A nurse wants to become part of a Disaster Medical Assistance Team (DMAT) but is concerned about maintaining licensure in several different states. What statement by the nursing supervisor best addresses these concerns? Using the standard reduction potentials Ni2+(aq) + 2 eNi(s) 0.25 volt Fe3+(aq) + eFe2+(aq) +0.77 volt Calculate the value of Ecell for the cell with the following reaction. Ni2+(aq) + 2 Fe2+(aq) Ni(s) + 2 Fe3+(aq) Solve |2x+3/4 |=5 1/2 Please help!!!! William andDebraPierce are celebrating their20th anniversary by having a reception at a local reception hall. They have budgeted$2,000 for their reception. If the reception hall charges a$50 cleanup fee plus$36 per person, find the greatest number of people that they may invite and still stay within their budget. What does the cross sign in the middle mean??? What did the framers believe was the fundamental purpose of government