virtual-labs-archive / computer-programming-responsive-iiith

This repository contains the responsive Computer Programming Lab IIITH
https://cse02-iiith.vlabs.ac.in
Other
1 stars 324 forks source link

Expression_Evaluation_Simulation #474

Open MohsinMamoon opened 5 years ago

MohsinMamoon commented 5 years ago

Issue: If an expression contains operators with same precedence, Instead of evaluating Left to Right (or Right to Left, depending on the operator) any particular operator is given more precedence, resulting in wrong answer.

Steps to reproduce:

  1. Go to http://cse02-iiith.vlabs.ac.in/exp10/simulation/index.htm
  2. Set a = 2
  3. Set b = 5
  4. Set c = 10
  5. Enter the expression to evaluate as: c / b * a

Expected result: 10/5 * 2 = 4

Actual Result: 1

Screenshot1: Screenshot from 2019-03-16 18-55-40

Screenshot2: Screenshot from 2019-03-16 18-45-58

MohsinMamoon commented 5 years ago

Fixed. Commit ID: 36dea70

DevikaBoddu commented 5 years ago

Valid fix @MohsinMamoon