Hello Sir!
Attaching a link in which code is already written you just need to add the Main method so I can run the program. Thanks
https://drive.google.com/file/d/12ywHMF2l0bnQihN_SSFRXFMy1PLc3GwN/view?usp=sharing
Using an imperative Definition, specify the abstract datatype for a software stack
1. A real number with only one decimal place is entered. Write a program that reverses it. For example, if the input is 5.7, the answer should be 7.5.
1. Heartbeat: Write a program that prompts for a person’s age in years and heartbeats rate per minute. The program computes and outputs the number of heartbeats since the person was born. You may assume that there are 365 days in a year.
output/input:
“Operating systems keep evolving over the period of time.” Elaborate the statement and also discuss various types of operating system. [10]
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that the only positive integer that is a power of "1" is "1" itself.
After writing your is_power function, include the following test cases in your script to exercise the function and print the results:
print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))
You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.
List and describe three possibilities to consider if a function is not working ?
Create examples of each possibility and list the code for each example ?
Define " precondition " and " precondition " ?
write a multi-threaded Java program that
(i) Has a single Producer class object which is a thread and a single Consumer class which is also a thread.
(ii) Create a class Packet. This class should contain a simple string.
(iii) Create a class Buffer that internally uses some data structure to hold the incoming packet objects – it should have methods insertPkt and remove Pkt and should have methods to tell the user how many packets are in the Buffer at any time e.g. size.
(iv) Make the Producer object at random time intervals create Packet objects and place them in the Buffer object.
(v) OBJECTIVE: Use a mechanism from the books Concurrency chapter to synchronize the producer thread pushing packets into the Buffer and the consumer thread removing them such that the Buffer size always remains between 50-70 packets.
(vi) Show through any means how your objective is met by running the Producer and Consumer object.