[solved] – Question 85881
According to information obtained from mathematics department regarding three mathematics units done by 100 students, those who are doing calculus are 45, those doing discrete are 49 and those doing statistics are 38. Those doing calculus and discrete are 17, those doing calculus and statistics are 12 and those doing the three units are 5. Use Venn diagram to find the number of students doing discrete and statistics but not calculus.
Expert Answer
[solved] – Question 859
Write an algorithm that counts the number of occurrances of a particular number from a given list of numbers.
Expert Answer
[solved] – Question 85935
what is the output? x = 9 % 2
if (x == 1):
print (“ONE”)
else:
print (“TWO”)
Expert Answer
[solved] – Question 85947
Franks come 7 to a package. Hot dog buns come 8 to a package. Write a simulation of buying packs of franks and hot dog buns until you have used up packs of both at the same time.
Declare appropriate constants for the amount per each type of package, variables for number of packages purchased, number of franks in a package left and buns in a package left. Run your simulation by starting with 1 pack of franks and 1 pack of buns. Use a loop to drive simulation. Each iteration represents the use of one frank and one bun. Design the control of your loop to end when you have run out of buns and franks at the same time. In your loop if you run out of one before the other simulate purchase of a new package and set the number left back to the number that come in a package.
Keep count of each package purchase so that you can display the number of packages of franks purchased and the number of packages of buns purchased after your loop completes.
Expert Answer
[solved] – Question 85965
Using JFLAP, create a PDA (pushdown automata) for the following two language(s):
L = {a^n b a^n | n > 0}
both are seperate
L = {a^i b^j c^k | i = j or i=k, i, j, k > 0}
Expert Answer
[solved] – Question 8598
write a program bus ticket. program must have departure time, arrival time, list of the passengers and transit check point.
Expert Answer
[solved] – Question 86060
Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and associates that value with total. Thus your code should associate 1*1 + 2*2 + 3*3 +… + 49*49 + 50*50 with total. Use no variables other than k and total.
Expert Answer
[solved] – Question 8612
You are a manager of a parking lot and decide to keep track all the cars parked in your lot. You want to know the maker, model, color, and license plate of the cars. Since you learned about ArrayList and you like to use an ArrayList to keep track of cars entered the lot. Each time a car left the lot, the remove method of ArrayList class can be used. Each time a car entered, add method can be used. To keep track how many cars in the lot, the size method can be used.
But before you write your application to create a class called MyParkingLot, you have to write a class call Car which contains all the information you need as describe in the previous paragraph. Also develop constructor(s) and getters or setters as needed so that you can retrieve (get) and record (set) information such as maker, model, color, and license plate number.
For MyParkingLot class, it shall consist of an ArrayList which will be used to maintain the information of all the cars in and out of this parking lot.
Expert Answer
[solved] – Question 86145
Create a class called time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments.
A main( ) program should create two initialized time objects and one that isn’t initialized. Then it should add the two initialized values together, leaving the result in the third time variable. Finally it should display the value of this third variable.
Expert Answer
[solved] – Question 8617
Take quantity and price from the user.
Calculate the total payment ( payment = quantity * price ).
Display the quantity, price and payment.
Repeat the program as long as the user key in ‘1’.
Use while loop for this question.
Expert Answer

