Structure and Making Decisions

profileraybetts1
Unit1-10.docx

Computer languages with low-level machine instructions are those in which only a computer can understand their instructions. "High and Low-Level Languages," 2020 defines low-level machine languages as binary digits containing either 1s or 0s. The issue of portability is one of the many challenges of programming in machine languages. Programs created using low-level machine languages are less portable because the machine language depends on the machine. Due to the lack of compilers and interpreters, low-level machine languages present a challenge during the debugging process. Due to this, low-level machine language programs are more likely to contain errors. As low-level programming is complex, it takes a great deal of time to write the program and fix any errors that are found. 

Programming with an object-oriented paradigm utilizes objects to organize code. There are advantages and disadvantages associated with OOP. Utilizing the inheritance aspect of OOP, you can re-use code as an example of OOP's advantage. As a result of object-oriented programming, the class's attributes can be inherited by its subclasses (Keogh, Giannini, & Rinaldi, 2004). The polymorphism benefit of OOP allows functions to be reused across classes without modifying their names. Encapsulation is another advantage of OOP, where methods and data are bundled together (Dai, 2019). Programs written in OOP languages can be debugged more easily with encapsulation. The technique of OOP also provides a feature of abstraction that makes a program more secure. The disadvantages of OOP are also varied, including the size of the programs created using it. Compared to other paradigms, OOP programs have a large size, which affects their speed. In comparison to other paradigms, the OOP paradigm creates large programs which impede its speed.

Part II.

1. Flowchart to Calculate Tax

2. Flowchart to Calculate Time Difference

3. Flowchart to Calculate Age

REFERENCES

High and Low Level Languages: Types, Most Popular. (2020, November 13). Retrieved January 17, 2021, from https://teachcomputerscience.com/high-low-level-languages/

Dai, R. (2019). Encapsulation and Polymorphism. In Learn Java with Math (pp. 181-183). Apress, Berkeley, CA.

Keogh, J., Giannini, M., & Rinaldi, W. (2004). OOP demystified. McGraw-Hill, Inc..

Start

"Enter the Sales Tax Rate"

GET salesTax

salesTax ← salesTax / 100

"Enter a Price"

GET price

taxAmount ← price *

salesTax

totalPrice ← price +

taxAmount

PUT "The amount of tax on

the item is: " +taxAmount¶

PUT "The total pricewith tax

is : " + totalPrice¶

End

Start

"Enter time in HH:MM

format, enter only hours here"

GET hours1

"Enter time in minutes"

GET minutes1

time1 ← (hours1 * 60) +

minutes1

"Enter time in HH:MM

format, enter only hours here"

GET hours2

"Enter time in minutes"

GET minutes2

time2 ← (hours2 * 60) +

minutes2

time1 < time2

timediff ← time2 - time1timediff ← time1 - time2

NoYes

PUT "The time difference in

minutes is : " +timediff¶

End

Start

"Enter your Birth year"

GET bYear

"Enter your birth month"

GET bMonth

"Enter your birth date"

GET bDay

mDays ← 30

nYears ← 2021 - bYear

nMonth ← bMonth *

mDays

nDays ← (nYears * 365) +

nMonth + bDay

nHours ← nDays * 24

nMinutes ← nHours * 60

nSeconds ← nMinutes * 60

PUT "You are " + nDays +"

days old"¶

PUT "You are " + nHours +"

hours old"¶

PUT "You are " + nMinutes

+" minutes old"¶

PUT "You are" + nSeconds

+" seconds old"¶

End