Chapter 7Assignment(Popular Candy)–15points Your goal is to record the sales for 4 different types of candy and determine the total sales and the names of the highest and lowest selling candies.
•Create a String array that stores four different types of candy. Pick whatever candy you would like.(3points)•
Have the program prompt the user to enter the number of candy boxes sold for each type of candy using an array. Do NOT accept negative values for the number of candy boxes sold. Store these numbers into an integer array.(6 points )
•Display the total sales, and the names of the highest selling and lowest selling candy items.(6points)
Write a Java program to display the three top sales made by employees of an organization. The rows and columns represent the sales made by each employee identified by their employee number. SALES 1 SALES 2 SALES 3 101111 R 3 000 R 2 000 R 3 500 101122 R 2 500 R 5 500 R 3 500 101133 R 1 100 R 2 000 R 4 500 101144 R 1 700 R 2 700 R 2 500 101155 R 5 000 R 2 900 R 5 900 Using a Two Dimensional array produce the employee sales report, and the total sales made by each employee.
What is the output of the first round of the DES algorithm when the plaintext
and the key are both all ones?
To qualify for an International Conference for Women in Computing (ICWC) next year in Toronto, Canada a student have got a distinction (a mark greater than 75) in PRG510S, be a female, and below the age of 25. Write a simple program that receives a mark, gender, and age from the keyboard and displays a corresponding message basing on the input.
Sample Run 1:
Mark: 70
Gender: female
Age: 21
Output1: Unfortunately you do not qualify!
Sample Run 2
Mark: 83
Gender: female
Age: 21
Output2: Congratulations! You might be in Toronto, Canada next year for ICWC!Three employees in a company are up for a special pay increase. You are given a file, say Ch3_Ex5Data.txt, with the following data:
Miller Andrew 65789.87 5
Green Sheila 75892.56 6
Sethi Amit 74900.50 6.1Each input line consists of an employee’s last name, first name, current salary, and percent pay increase.
For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87, and the pay increase is 5%.
Write a program that reads data from a file specified by the user at runtime (i.e. your program should accept the filename as user input) and stores the output in the file Ch3_Ex5Output.dat. To test your program, use the Ch3_Ex5Data.txt file.
Your program will not pass all checks if it does not accept a filename as input from the user.
For each employee, the data must be output in the following form: firstName lastName updatedSalary.
A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies.
Write a program that prompts the user to enter:
The program then outputs:
Note that each box must contain the specified number of cookies, and each container must contain the specified number of boxes. If the last box of cookies contains less than the number of specified cookies, you can discard it and output the number of leftover cookies.
Similarly, if the last container contains less than the number of specified boxes, you can discard it and output the number of leftover boxes.
Suppose that billingAmount is a double variable, which denotes the amount you need to pay to the department store. If you pay the full amount, you get $10.00 or 1% of the billingAmount, whichever is smaller, as a credit on your next bill; If you pay at least 50% of the billingAmount, the penalty is 5% of the balance; If you pay at least 20% of the billingAmount and less than 50% of the billingAmount, the penalty is 10% of the balance; otherwise the penalty is 20% of the balance. Design an algorithm that prompts the user to enter the billing amount and the desired payment. The algorithm then calculates and outputs the credit or the remaining balance. If the amount is not paid in full, the algorithm should also output the penalty amount.
Since your program handles currency, make sure to use a data type that can store decimals with a precision to 2 decimals.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
for i in range(0,len(displayList)):
#Test if the fist item in the current sub-list contains the text "Price Level
#Tip: Remeber that each sub-list is a (displayList). So you have
#to access its items via displayList followed by TWO indexes.
if i == "Price Level":
#Extract the second item from the current sub-list into variable called priceLevel
priceLevel = i
#Test if priceLevel is between previousPrice and currentPrice OR
# pL == pP OR
# pL == cP
if priceLevel >= previousPrice and priceLevel <= currentPrice or priceLevel == previousPrice or priceLevel == currentPrice:
if self.__currentPrice <= self.__previousPrice:
frequency = 400
duration = 700
#Sound the alarm. Pass in the frequency, duration.
else:
frequency = 800
duration = 700
winsound.Beep(frequency, duration)
#Print the text 'Alarm'
#can go back and check when the alarm was sounded.
print(Back.GREEN + "Alarm" + Style.RESET_ALL)
if __name__ == '__main__':
displayList = ['Price level']
play = Play()
# function call
play.ls(0, 100)CreateabaseclasscalledAnimalwhichhas2classfields.ThefirstfieldholdsanintegerIDtagfora numberthatazoousestocataloguetheiranimals&thesecondfieldholdsastringcalledspecies. FromtheAnimalclass,derive2classesOneisBird&theotherReptile.Birdclasshasanadditional classfieldcalledcolourwhichholdsthe colour of the birds feathers(int – 1=grey, 2=white, 3=black).reptile class has an additional class field called bloodTemp which hold the reptiles temperature of their blood (double).You need to instantiate two 2 objects.bird object will be called brd.reptile object called rept.Input values for the bird’s IDtag,species & feather colour(int) & for the reptile’s IDtag number,species & bloodTemp.Override the Animal class’s input & output methods.Each derived class must have its own constructor.Write methods to input & output values to the class fields for all classes & then print out the values of the bird & reptile class fields with labels identifying the values.