TotalCoins

TotalCoins 1

Write a program that determines the value of the coins in a jar and prints the total in dollars
and cents. Read integer values that represent the number of quarters, dimes, nickels, and
pennies. This program will require user input, output needs to have the correct currency
format without using the currency formatting code.

substitutionDecrypt

substitutionDecrypt 2

Write the substitutionDecrypt method.
Test your algorithm as shown below.
Your code should work for any key.
Sample output using testKey1 (‘zyxwvutsrqponmlkjihgfedcba’) and cipherText message
(‘gsv jfrxp yildm ulc’) from substitution.py file (see source file under ch. 03 link on
Canvas)CipherText: gsv jfrxp yildm ulc
PlainText: the quick brown fox

MobilePhoneBill

MobilePhoneBill 3

Write a C program to calculate the amount of a simple mobile phone bill. A call is charged 30 cents per minute. The cost for line rental data is RM39.00 per month. The tax for the overall bill is 6%. Calculate the total amount the user needs to pay to the Telco based on the number of minutes the user uses his/her mobile phone for call every month. Creatively do the input/output format of the program.

ImprovedContains

ImprovedContains 4

Write a function, ImprovedContains, that takes three arguments: a string representing the text to search, a string representing the pattern to search for, and a pointer to bool that represents if the search should be case insensitive. This function should return true if the pattern is found in the text, false otherwise.

ArchitectAreaCalculator

ArchitectAreaCalculator 5

An Architect company needs a program to calculate the area of different shapes (rectangles, triangles and circles) based on their dimensions given by the user. The program must first display a menu that allows the user to select a shape. The program must then allow the user to enter the dimension(s) of the chosen shape and compute the area. All dimensions should be real numbers (decimal numbers) and the calculated area should be displayed with 2 decimal digits. The output of your program must look like the sample output below.

For a rectangle, the program should ask for the width and the length, and calculate the area as width * length.
For a triangle, the program should ask for the height and the base and calculate the area as (height *base) /2.
For a circle, the program should ask for the radius and calculate the area as 𝜋 * radius2.

INPUT VALIDATION: All user input must be validated and the program should terminate in case of invalid input. When selecting a menu item, if the user’s input is not 1, 2, 3 or 4, the program should terminate with an error message. For room dimensions, only positive values should be accepted. If the user enters 0 or a negative value, the program should again terminate with an error message.

Teaching UML & JAVA

Teaching UML & JAVA 6

Read the following short passage of the text to identify the class candidates as well as their possible relationships – composition or aggregation that might exist among them:
Assume that we defined a teaching course with attributes: name, dept, year, semester (with values F – “Fall”, S- “Summer”, W- “Winter”).
Also semester is associated with:
– course description (a paragraph of text),
– professor with his office number, and a phone extension (note that one course could be instructed by only one instructor, and one instructor may teach several courses at the same time),
– student may be enrolled to the course (note that course may have up to 30 students), and each student should receive an average course mark.1) First you have design a UML class diagram. You may choose to use aggregation/ composition – where necessary.
2) Java implementation: Implement all required classes in Java, according to UML class diagram. Create a test class with one course instructed by one specific professor, and add a list of students enrolled into this course. Note: at the end, the program should calculate a course average student’s mark for particular course. You are expected to add all programming comments in your code.

Random List Python

Random List Python 7

Write a Python program to randomly divide the students in this class into five groups for term projects, each group should have at least 3 students but no more than 5 students (including 5). Here is the students list: (3 points for extra)studnet_list = [‘vmb0067′,’pc0353′,’snd0097′,’yye0005′,’sg0940′,’bk0301′,’rak0120′,’rrk0058′,’spk0057′,’vl0135′,’nm0547′,’pn0159’, ‘msp0174′,’dd0420′,’ds0761′,’rs0850′,’ss1995′,’at0739′,’at0768′,’mv0299′,’tv0119′,’dy0091’]

Inheritance JAVA

Inheritance JAVA 8

A publication has a title and a publisher (both of type String). A book is a publication with an author and
an ISBN number (both of type String). A library book is a book with a catalogue number and a copy
number (both of type int).
Using inheritance write a class hierarchy for publication, book and library book. The base class should be
called Publication. Each class should have a parameterised constructor that calls the constructor in the
super class.
*Note: getter, setter and toString methods are not required for any of these three classes.

Dimes Python

Dimes Python 9

Vending machines on campus sell lots of goodies for nominal fees. Assume that all snacks cost
between 25 cents and 1 dollar, and prices are always multiples of 5.
A user can only buy 1 item at a time, and the machine only accepts a single dollar bill for each
transaction. You need to determine the correct change to be dispensed.
You’ll need to prompt the buyer for the price of their item and then determine their change in
terms of # of quarters, # of dimes and # of nickels.
Very few people prefer to get all nickels as their change, so be sure to always calculate
quarters, then dimes, then nickels.
You should also make sure that your output is grammatically correct, such that if only 1 nickel is
owed, then you output nickel rather than nickels.
This program is meant to test your understanding of input statements, output statements, if-else
statements, functions, and mathematical calculations.

Task1 Task2 Python

Task1 Task2 Python 10

Task 1

Create a program called task1.py.
This program needs to display the timetables for any number.
For example, say the user enters 6 the program must print:
The 6 times table is:
6 x 1 = 6
6 x 2 = 12

6 x 12 = 72
Compile, save and run your file

Task 2

A simple rule to determine whether a year is a leap year is to test whether it is
a multiple of 4.
Create a program called task2.py.
Write a program to input a year and a number of years.
Then determine and display which of those years were or will be leap
years.
What year do you want to start with? 1994
How many years do you want to check? 8
1994 isn’t a leap year
1995 isn’t a leap year
1996 is a leap year
1997 isn’t a leap year
1998 isn’t a leap year
1999 isn’t a leap year
2000 is a leap year
2001 isn’t a leap year
Compile, save and run your file.

×
New Download