{"id":132288,"date":"2023-08-20T13:27:08","date_gmt":"2023-08-20T13:27:08","guid":{"rendered":"https:\/\/assignmenttutors.net\/blog\/assignment-information-due-in-8hrs\/"},"modified":"2023-08-20T13:27:08","modified_gmt":"2023-08-20T13:27:08","slug":"assignment-information-due-in-8hrs","status":"publish","type":"post","link":"https:\/\/assignmenttutors.net\/blog\/assignment-information-due-in-8hrs\/","title":{"rendered":"assignment information. due in 8hrs"},"content":{"rendered":"<div>\n<p>I have attached the hw3 template. I need it soonest possible.<\/p>\n<p>A prefix expression is one where each operator appears before its two operands.\u00a0 For example the fully parenthesized infix expression ( ( ( a + b) \/ (c+d) ) * (e \/ f) ) becomes the prefix expression\u00a0 *\u00a0 \/\u00a0 +\u00a0 a\u00a0 b\u00a0 +\u00a0 c\u00a0 d\u00a0 \/\u00a0 e\u00a0 f.\u00a0 The object of this assignment is to write a program to convert a fully parenthesized infix expression to its equivalent prefix expression. Assume the input infix expressions consist only of variables a through z, operators +,\u00a0 -,\u00a0 *, \/ \u00a0 and parentheses &#8216;(&#8216;, &#8216;)&#8217; .\u00a0 Use the following algorithm:<\/p>\n<p>(1) Create three stacks of characters: stk1, stk2, stk3.<\/p>\n<p>(2) Read the input infix expression one character at a time and push every character read ( other than &#8216;)&#8217;\u00a0 ) onto stk1. Do not push the character read if it is &#8216;)&#8217;.<\/p>\n<p>(3)\u00a0 As long as stk1 is not empty, do the following:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Fetch the top character ( call it c ) of stk1 and pop stk1.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if c is an alphabetic character (a-z),\u00a0 push it onto stk3. (You can use the function islower(c) to test if character is one of a-z.)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if c is an operator,\u00a0 push it onto stk2.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if c is &#8216;(&#8216; then fetch the top character of stk2, push it onto stk3, and pop stk2.<\/p>\n<p>(4)\u00a0 Print stk3 top to bottom by repeatedly fetching the top of stk3, printing it, and popping stk3, until stk3 is empty.<\/p>\n<p>There is starter code in folder Hwk3 in your course folder on comsci.\u00a0 Open the project file Hwk3.cbp in codeblocks and complete the program hw3.cpp in that project.<\/p>\n<p>The program uses the class template <strong>stack<\/strong> from the standard C++ library. Check the examples on the slides for how to push, pop, and check for empty stack.<\/p>\n<p><strong>Do not submit through Blackboard!<\/strong> \u00a0<strong>Just leave everything in the homework folder.<\/strong><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have attached the hw3 template. I need it soonest possible. A prefix expression is one where each operator appears before its two operands.\u00a0 For example the fully parenthesized infix expression ( ( ( a + b) \/ (c+d) ) * (e \/ f) ) becomes the prefix expression\u00a0 *\u00a0 \/\u00a0 +\u00a0 a\u00a0 b\u00a0 +\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-132288","post","type-post","status-publish","format-standard","hentry","category-education"],"_links":{"self":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/132288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/comments?post=132288"}],"version-history":[{"count":0,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/132288\/revisions"}],"wp:attachment":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/media?parent=132288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/categories?post=132288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/tags?post=132288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}