Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

2.   Construct a class named student consisting of a student identification number, list of five grades, and an integer representing the total number of grades entered. The constructor for this class should initialize all student data members to zero.


Included in the class should functions/ methods for:

1.    constructor and a destructor.

2.      enter a student number

3.      enter a single test grade (used loop for entering 5 grades)

4.      set test grade

5.      compute an average grade

6.      display the student number and average grade.



1.   You operate several BurgerStands distributed throughout town. Define a class named BurgerStand that has a member variable for the burger stand's id number and member variable for how many burgers that stand sold that day.


a)           create a constructor that allows user of the class to initialize values for id number and for how many burgers sold that day and a destructor

b)           create a function named justsold that show increments of the number of burgers the stand has sold by one. (This function will invoked each time the stand sells a burger so that you can track the total number of burgers sold by the stand. And returns the number of burgers sold.)

c)           create a function that calculate the total number of burgers sold by all stands.

d)           write in a data file, the list of burger stands and the total number of burgers sold by all stands.



The garments company apparel wishes to open outlets at various locations .the comapny short listed several plots in these locations and wishes to select only plots that are square shaped .

Write an algorithm to help apparel to find number of plots that it can select for its outlets


#Write a program that simulates using a bank machine. I have listed five 5 functions that should be called in the main program that you have to complete. I also have taken the liberty of starting the skeleton code for you. You need to write the code for each functions and then create the main code that will call for these functions. (Perhaps the program should run in the while True loop as I have started for your at the bottom).



def getDepositeAmount():

#should handle getting input from the user. Make sure your value is an int or float.

return #deposit amount




def deposit(depositAmount, accountBalance):

#should add the deposit to the account balance


return #the new account balance



def getWithdrawalAmount(accountBalance):

#should handle getting input from the user and evaluate if the withdraw amount is less than the account balance. This function should continue to loop until the value of the withdrawal is less than or equal to the accountBalance


return #The function should return the withdrawl value



def withdraw(withdrawlAmount, accountBalance):

#should subtract the withdrawl amount from the account balance


return #return the new account balance



def printBalance(accountBalance):

#should print out the current account balance in a nicely formatted way. Maybe ...

#*****************************************

#Your account balance is: $1090.89

#*****************************************


return



#You need to start with an account balance, feel free to make yourself a billionaire if you like. Right now I have set it to default $0.00

acountBalance = 0.00



while True:

#main program should run here. Feel free to edit to change the code here. This is just a demo.

userChoice = int(input('Welcome to your bank. Please pick one of the following options....\n1. Deposit\n2. Withdrawal\n3. Account balance\n4. Exit bank\nEnter your choice [1,2,3,4]:'))





1.   You operate several BurgerStands distributed throughout town. Define a class named BurgerStand that has a member variable for the burger stand's id number and member variable for how many burgers that stand sold that day.


a)           create a constructor that allows user of the class to initialize values for id number and for how many burgers sold that day and a destructor

b)           create a function named justsold that show increments of the number of burgers the stand has sold by one. (This function will invoked each time the stand sells a burger so that you can track the total number of burgers sold by the stand. And returns the number of burgers sold.)

c)           create a function that calculate the total number of burgers sold by all stands.

d)           write in a data file, the list of burger stands and the total number of burgers sold by all stands.



In this problem, you are required to use spark.ml API. As in Problem 2, consider 3

objects:

(1) The first object, denoted by OA, is a ball centered at (0; 0; 0) of radius 1. As a

set of points, we write OA = f(x; y; z) j x2 + y2 + z2  1g.

(2) The second object, denoted by OB, is a cylinder defined by OB = f(x; y; z) j

  • x^2 + y^2  4; 2  z  4g.

(3) The third object, denoted by OC, is an ellipsoid

OC = f(x; y; z) j (x 􀀀 2)2

1:2

+ y2 +

z2

4

 1g

Note that OA overlaps with OC a little bit.

Create a dataset in the following way:

(1) Each record in the dataset corresponds to a point contained in the union of OA,

OB and OC, which has a “features” part which is made of the xyz coordinates

of that point and a “label” part which tells which of OA, OB or OC this point

is contained in. Note that since OA \ OC is nonempty, if the point happens to

locate in OA \ OC, you still can only label it as OA or OC, but not both.

(2) The dataset you create should contain at least 500000 records. You should generate

the records randomly in the following way:

i. Each time, choose OA, OB or OC randomly. Suppose we choose OX (X is A,

B or C).

ii. Randomly create a point P contained in OX (think of how to do it). Now

the features of the newly created record is the coordinates of P and the

corresponding label is “OX”.

iii. After creating all the records, you should load and transform the dataset to

a spark Dataframe.

You are required to do the following work.

(1) Do classifications using both logistic regression and decision tree classifier. You

should try several different training/test split ratio on your dataset and for each

trained model, evaluate your model and show the accuracy of the test.

(2) Use K-means clustering to make cluster analysis on your data. Now only the

“feature” part of your data matters. Set the number K of clusters to 2, 3 and 4

respectively and make a comparison. Show the location of the centroids for each

case.

(3) Provide a visualization of the results of your classifications and cluster analysis.

In your report, you should provide both your codes and your demonstration of the

results. Take screenshots whenever necessary


'''


(a) Ask the user to enter 5 integer values between 1 and 50. Create a simple bar graph using the character of your choice.

Hint: You may want to try to use a loop within a loop (a nested loop). Don't forget to indent properly! (2A)

For example: If the user were to enter 3, 1, 6, 2, 5, the output might look like:

###

#

######

##

#####

Extension:

(d) [challenge] Make the bar graph horizontal (2T)



Write the program in python language 

Scenario is

A fair has come to the city and the price of the entry tickets are as below:

AGE TICKET PRICE

Below 6 years Rs 20/-

6 to 9 years Rs 30/-

10 to 17 years Rs 50/-

18 years and above Rs 100/

They are giving a discount of 5% on their ticket price as part of their anniversary.

(So, discount amount= 0.05*ticket price)

Write a program to:

● Accept the age of the customer and calculate the total amount of the ticket after discount.

● Finally display the age and total amount calculated after discount with appropriate message.


#(a) Write a program that asks the user the same single, simple, random math problem until they get it right. (1A, 1C)

#(b) Add the option for the user to specify how many problems they want to answer. (1A)

#(c) Don't do a fixed number of questions. Instead, ask the user at the end of each question sequence (i.e., when they finally get it right) if they want to continue. (1C)

#(d) Keep track of the user's attempts and the total number of questions, and then report their score (i.e., "you took X tries to answer Y questions correctly") (1A)

#(e) Set a maximum number of tries for each question. When the user makes their last guess, tell them the answer and move on. (1A)


#(a) Write a program that asks the user the same single, simple, random math problem until they get it right. (1A, 1C)

#(b) Add the option for the user to specify how many problems they want to answer. (1A)

#(c) Don't do a fixed number of questions. Instead, ask the user at the end of each question sequence (i.e., when they finally get it right) if they want to continue. (1C)

#(d) Keep track of the user's attempts and the total number of questions, and then report their score (i.e., "you took X tries to answer Y questions correctly") (1A)

#(e) Set a maximum number of tries for each question. When the user makes their last guess, tell them the answer and move on. (1A)


LATEST TUTORIALS
APPROVED BY CLIENTS