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 an IceCreamCone c++ class with fields for flavor, number of scoops, cone type, and price.

Unless arguments are supplied, flavor defaults to "Vanilla," number of scoops defaults to 1, and

cone type defaults to "Sugar"

The constructor calculates the price based on 75 cents per scoop, with an additional 40 cents for a waffle cone.


Write a program to find the greatest common factor if the two numbers are provided in the main function.



Use pass by value mechanism to compute the greatest common factor and return the result back to the main



function then display the result in the main function.




Write a class named TestScores. The class constructor should accept an array of test scores as its

argument.

The class should have a member function that returns the average of the test scores. If any test

score in an array is negative or greater than 100 it should display a message.


You are required to implement a shopping cart module for an online shopping mall. From the available

items a user will select the item to purchase and add this into his shopping cart. Before the checkout

customer can remove any item from the cart at any time.

A single item in the cart contains the following details:

class Item

{

private:

int itemID;

string itemName;

double price;

double purchasedQuantity;

double totalPrice;

public:

//constructors and getter setters

};

For the implementation of the required module you have to meet the following requirements:

3- Customer can also view his cart at any time. You have to provide two features for the user in order

to view his cart:

i. View cart: it will display all the items that customer selected to purchase.

ii. View cart by items: Display one item and facilitate user to navigate through next or

previous item in the cart till the user wants to quit the view.


You are required to implement a shopping cart module for an online shopping mall. From the available

items a user will select the item to purchase and add this into his shopping cart. Before the checkout

customer can remove any item from the cart at any time.

A single item in the cart contains the following details:

class Item

{

private:

int itemID;

string itemName;

double price;

double purchasedQuantity;

double totalPrice;

public:

//constructors and getter setters

};

For the implementation of the required module you have to meet the following requirements:

2- Customer can remove item or change the quantity at any time.

There are two possibilities:

i. Customer wants to remove the item form the cart

ii. Customer wants to change the quantity of item in the cart


You are required to implement a shopping cart module for an online shopping mall. From the available

items a user will select the item to purchase and add this into his shopping cart. Before the checkout

customer can remove any item from the cart at any time.

A single item in the cart contains the following details:

class Item

{

private:

int itemID;

string itemName;

double price;

double purchasedQuantity;

double totalPrice;

public:

//constructors and getter setters

};

For the implementation of the required module you have to meet the following requirements:

1- Customer can add any item to the cart in desired quantity.

Remember if customer added the same item in the cart again, your implementation will not add

this as a new item it will check if the item already exists than it will just add the new quantity in

the previous and update other data.


Create a program that will String input. Based on the number of inputs,


the USER will decide what shape it is circle,rectangle,square and triangle.


(1 input – circle, 2 inputs – square or rectangle, 3 inputs - triangle).


The program will then display the shape type, details, perimeter and area.


USE TRY AND CATCH



Justines-MacBook-Pro:classes Justine$ java-jar Shape.jar15


Type:Circle


Radius:15


Perimeter:94.2


Area:706.5




Justines-MacBook-Pro:classes Justine$ java-jar Shape.jar15


Type:Rectangle


Length:24


Width:12


Perimeter:72.0


Area:288.0




Justines-MacBook-Pro:classes Justine$ java-jar Shape.jar15


Type:Square


Side:12


Perimeter:48.0


Area:144.0




Justines-MacBook-Pro:classes Justine$ java-jar Shape.jar 9 15 12


Type:Triangle


Sides:9, 15, 12


Perimeter:36.0


Area:54.0




Justines-MacBook-Pro:classes Justine$ java-jar Shape.jar 9 15 12 8


Invalid input




class:


-TestShape


-Shape


-Circle


-Rectangle


-Square


T-riangle


Using nested loops, write code to produce the following output. (8 marks)


NB: Use only two loops.


1 2 3 4 5 6 7 8


1 2 3 4 5 6 7


1 2 3 4 5 6


1 2 3 4 5


1 2 3 4


1 2 3


1 2


1

Write a program that accepts a list of integers and computes their sum. The program should allow the user to enter any number of integers but an input of zero should terminate the list. For example if the user enters 2 5 6 12 8 2 0 the sum should be 35. If he/she enters 2 4 5 0 the sum should be 11 and if he enters 5 4 6 0 12 43 2 the sum should 15 i.e. only numbers before zero are summed. The rest are ignored and the program terminated. (5 marks)



Discuss the IPv4 Datagram with the help of suitable examples.


LATEST TUTORIALS
APPROVED BY CLIENTS