Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

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

Create ProductMock Entity which throws DataEntryException when its properties initialize with following values. Get the Product details from the user and handle in-built and user defined exception. Refer the class diagram given below :


Condition | Exception Message

__________________________________________________________________________________

productID <=0 | Product ID must be greater than zero productName = = “” | Product Name cannot be left blank

price <=0 | Price of product must be greater than zero.

productName | Product Name should have alphabets and numbers only


Product Mock:

ProductId: int

ProductName: String

Price: Double


Output:

Enter Id: -32

Enter Product Name: Compaq Laptop

Enter Price: 32000


Product Id must be greater than 0


ABC Corp wants to maintain list of Customers. While accepting the data, you need to validate CreditLimit property. If the value is invalid, you need to raise Exception. We need to implement custom exception class to implement the same.


Task 1: Define a Customer class with following members CustomerId, Customer Name, Address, City, Phone, CreditLimit


Task 2: Define the properties for all these members.


Task 3: Define two constructors (Default and Parameterised) to assign the values.


Task 4: You need to validate the CreditLimit. If the value is above 50000, then you need to raise Exception to handle this. Create InvalidCreditLimit custom Exception class to achieve the same.


Task 5: Use the Exception class created to throw the exception. Ensure that the Client application catches the exception and handles the error properly.


There is a Change request from the customer. It is as follows: You need to calculate Interest paid by banks on Saving Account.


Task 1 : Add a function declaration “void CalculateInterest()” in the interface. Define the functions in the concrete classes such as ICICI accounts get 7% interest and HSBC gives 5% interest.


Create two classes named Mammals and SeaAnimal. Create another class named Whale which inherits both the above classes. Now, create a function in each of these classes which prints "I am mammal" in class Mammals, "I am a marine animal” in class SeaAnimal and "I belong to both the categories: Mammals as well as Marine Animals" in class Whale. Now, create an object for each of the above class in main function and try calling.

1 - function of Mammals by the object of Mammal

2 - function of SeaAnimal by the object of SeaAnimal

3 - function of Whale by the object of Whale

4 - function of each of its parent by the object of Whale



  1. Create a class named Time that contains integer fields for hours and minutes. Store the hour in military time that is, 0 to 23. Add a function that displays the fields, using a colon to separate hours and minutes. (Make sure the minutes displays as two digits. For example, 3 o’clock should display at 3:00, not 3:0). Add another function that takes an argument that represents minutes to add to the time. The function updates the time based on the number of minutes added. For example, 12:30 plus 15 is 12:45, 14:50 plus 20 is 15:10, and 23:59 plus 2 is 0:01. The Time constructor ensures that the hour field is not greater than 23 and that the minutes field is not greater than 59; default to these maximum values if the arguments to the constructor are out of range. Create a main() function that instantiates an array of at least four Time objects and demonstrates that they display correctly both before and after varying amounts of time have been added to them.
  1. Write a class definition for a Dog. Private data fields include name, breed, and age, and a constant static field for the license fee, which is $13.45. Create public member functions to set and display the data. Write a main() function that demonstrates the class operates correctly.

to develop an object-oriented application. They provide trucks, cars, and bikes on rent for a maximum period of 5 days, and if the number of days increases they double the rent for the extra days. They have different cars like luxury, sports and ordinary and all of them are powered by both electricity and petrol while trucks have only petrol option. In the case of bikes, they have electric street-bike and sportbikes have only petrol option. Further, the choice of the customer for the trucks is based upon weight, length, and wheels. The owner of the company can add, view and update vehicle, customer, and employee information.




Create a class: Doctor, with private data members: id, name, specialization and salary

with public member function: get_data () to take input for all data members, show_data

() to display the values of all data members and get specialization () to return

specialization. Write a program to write for detail of n doctors by allocating the

memory at run time only.


Write a Python program using text files to create a Smart Phone book that collects contact details from the user. Contact details refer to the contact’s full name (first name and last name), phone number, date of birth and a category that the contact belongs to (Friends, Family, Work, Other). The Phone Book will display the following Menu and will support the corresponding functionality:

Enter your choice: 1: Add a new contact 2: Remove an existing contact 3: Look up a contact 4: Update a contact phone number 5: Display all contacts 6: Delete all contacts 7: Exit phonebook



Based on Control Structure Selection and Control Structure Looping, answer the following questions:

Write a program that will ask the user to input n positive numbers. The program will terminate if one of those numbers is not positive. Output :

https://cdn.discordapp.com/attachments/711213157854609461/839150310864846934/unknown.png


LATEST TUTORIALS
APPROVED BY CLIENTS