0

Hi, thank you for taking the time to take a look at this.

So here's the deal, my assignment is to write a program that resembles the traditional version of bc. It will translate the more common way of writing arithmetic expressions into postfix form used by the dc utility.
Ok, so there is plenty of info how to write a program to convert to postfix notation, therefore thats not the issue. The issue being, I can't find any info on the bc/dc utilities, and can't really figure out how they choose their output, other than testing thousands of entries and expressions over and over. Our teacher simply expects us to be pros at the unix environment without any prior knowledge or lessons.

Examples of input and output, respectively.
1+2*3 -- 1 2 3*+ps
i=+2; -- li 2+si
a=b=c=0 -- 0dscdsbsa

if(x<4) -- [ 2sy ]s0
y=2; -- lx 4>0

Thanks for any help you may provide.
Paul

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by nezachem
0

> The issue being, I can't find any info on the bc/dc utilities

Did you try typing info dc (and/or info bc ) at the command prompt?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.