Find Jobs
Hire Freelancers

Stack

$15-20 USD

Concluído
Publicado há quase 22 anos

$15-20 USD

Pago na entrega
Program 5 Stack Write a program that uses a stack to determine if grouping symbols, such as parentheses and braces, if an arithamtaic expression matches. For example, the expression (25 + ( 3 - 6 ) * 8) contains matching grouping symbols. If the expressiom conatains error, output an appropriate error message. I am posting the main and header code for a program that needs to be modified to achieve the above requirment The main program // Postfix Calculator #include #include #include #include "my stack.h" using namespace std; void evaluate(ifstream& in,ofstream& out,stackType& stack, char& ch,int& flag); void discard(ifstream& in, ofstream& out, char& ch); int main() { double num, result; int flag; char ch; stackType stack(100); ifstream infile; ofstream outfile; [login to view URL]("a:[login to view URL]"); [login to view URL]("a:[login to view URL]"); [login to view URL](ios::fixed, ios::floatfield); [login to view URL](ios::showpoint); outfile<<setprecision(2); // print num to two decimal places infile>>ch; while(infile) { [login to view URL](); flag = 0; outfile<<ch; while(ch != '=') { switch(ch) { case '#' : infile>>num; outfile<<num<<" "; if(![login to view URL]()) [login to view URL](num); infile>>ch; outfile<<ch; if(ch != '#') outfile<<" "; break; default: evaluate(infile, outfile, stack, ch, flag); if(!flag) //if no error { infile>>ch; outfile<<ch; if(ch != '#') outfile<<" "; } }//end switch }// end while (!= '=') if(!flag) //if no error print result { if(![login to view URL]()) { [login to view URL](result); if([login to view URL]()) outfile<<result<<endl; else outfile<<" (Error: Too many operands)"<<endl; }//end if else outfile<<" (Error in the expression)"<<endl; } else outfile<<" (Error in the expression)"<<endl; outfile<<"_________________________________"<<endl<<endl; infile>>ch; //Begin processing the next expression }//end while return 0; }//end main void evaluate(ifstream& in, ofstream& out, stackType& stack, char& ch,int& flag) { double op1, op2; if([login to view URL]()) { out<<" (Not enough operands)"; discard(in,out,ch); flag = 1; } ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. ## Platform Win Me Visual C++ 6.0
ID do Projeto: 2848464

Sobre o projeto

9 propostas
Projeto remoto
Ativo há 22 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$17 USD em 14 dias
4,6 (66 avaliações)
5,1
5,1
9 freelancers estão ofertando em média $12 USD for esse trabalho
Avatar do Usuário
See private message.
$12,75 USD em 14 dias
4,9 (212 avaliações)
5,8
5,8
Avatar do Usuário
See private message.
$17 USD em 14 dias
4,4 (72 avaliações)
5,5
5,5
Avatar do Usuário
See private message.
$6,80 USD em 14 dias
4,6 (60 avaliações)
4,5
4,5
Avatar do Usuário
See private message.
$17 USD em 14 dias
5,0 (32 avaliações)
4,2
4,2
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
4,9 (5 avaliações)
2,8
2,8
Avatar do Usuário
See private message.
$15,30 USD em 14 dias
5,0 (7 avaliações)
2,6
2,6
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
5,0 (2 avaliações)
0,6
0,6
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
4,6
8
Membro desde abr. 8, 2002

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.