cs201 GBD no 1 solution
#1

Question:
Suppose you are required to write a C/C++ program for a bank in which all transactions of a day will be compared. Keep in mind a huge volume of transactions per day:
Your code should have following features:


The processing speed must be high.

The logic of the program must be simple.

Which decision structure (if-else and switch statement) would you choose to achieve above mentioned features of code, and also mention reasons in favor of your choice.

[Note: Answer must be comprehensive with logical reasoning. Confine your answer within 3 to 5 lines]

Help me in cs201 GDB no: 1
Reply
#2

(01-06-2018, 10:35 AM)fahadmukhtar Wrote:  Question:
Suppose you are required to write a C/C++ program for a bank in which all transactions of a day will be compared. Keep in mind a huge volume of transactions per day:
Your code should have following features:


The processing speed must be high.

The logic of the program must be simple.

Which decision structure (if-else and switch statement) would you choose to achieve above mentioned features of code, and also mention reasons in favor of your choice.

[Note: Answer must be comprehensive with logical reasoning. Confine your answer within 3 to 5 lines]

If-else decision structure should be used for the given required features and scenario, because overhead of switch statements is very high and as the number of transactions per day are huge, using switch statements will slow down the process considerably and the system will lag, hence the best option would be the use if-else decision structure as it will be faster and the logic of the system will also remain simpler.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Mishi Khan
05-07-2019, 08:18 PM
Last Post by Mishi Khan
02-02-2019, 08:25 PM
Last Post by Mishi Khan
12-22-2018, 07:32 PM



Users browsing this thread: 1 Guest(s)