Question about Computers & Internet

2 Answers

Can I get the asswer for the below questions

1. Using C++ , design and implement a class COMPLEX having the following functionality:a) allows representation of complex numbers
b) allows addition of two complex numbers
c) has overloading constructors and a copy constructor
d) allows assignment of one complex number to another

2. An EMPLOYEE class contains the following members:
Data members: employee_number, employee_name, basic pay, allowance, income tax, net salary
Member functions: to read the data, to calculate net salary and to print data members
Write a C++ program to read the data of 5 employees and compute the net salary of each employee given that the allowance is 20% of the basic pay and income tax is 30% of the gross salary (basic pay+allowance)

3. Assume that a bank maintains two kinds of accounts for customers, one called savings account and the other as current account. The savings account provides compound interest and withdrawal facilities but no cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level, a service charge is imposed.  
Create a class ACCOUNT that stores customer name, account number and type of account. From this derive the class CUR_ACCT and SAV_ACCT to make them more specific to their requirements. Include necessary member functions in order to achieve the following:
a) accept deposit from a customer and update the balance
b) display the balance
c) compute and deposit interest
d) permit withdrawal and update the balance
e) check for minimum balance, impose penalty, if necessary, and update the balance
Use member functions to initialize the class members. Do not use constructors.

4. Write a C++ program to create a class called QUEUE with member functions to add an element and to delete an element from the queue. Display the contents of the queue after every operation.

5. Write a C++ program to create a class called STRING and do the following operations. Show the results after every operation by overloading the operator <<. Use copy constructor.
STRING s1 = “KUVEMPU”
STRING s2 = “UNIVERSITY”
STRING s3 = s1+s2 

6. Write a C++ program to create a class called DATE. Accept two valid dates in the form dd/mm/yyyy. Implement the following operations by overloading the operators + and -. After every operation show the results by overloading the operator <<:
a) ndays = d1 – d2; where d1 and d2 are DATE objects, d1>=d2 and ndays is an 
  integer. 
b) d2 = d1 + ndays; where d1 is a DATE object and ndays is an integer.
 
7. Create a class FLOAT that contains one float data member. Overload all the four arithmetic operators so that they operate on the objects of FLOAT.

8. Create a base class called SHAPE. Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes called TRIANGLE and RECTANGLE from the base SHAPE. Add to the base class, a member function get_data() to initialize the base class data members and another member function display_area() to compute and display the area of the figures. Make display_area() as a virtual function and redefine this function in the derived classes as per the requirements. Using the three classes, design a program that will accept dimensions of a triangle or rectangle interactively and display the area. The two values given as input will be treated as lengths of the two sides in the case of a rectangle and as base and height in the case of triangles. 
Area of a rectangle = side1 * side2
Area of a triangle = ½ * side1 * side2

9. A book shop maintains the inventory of books that are being sold at the shop. The list has details like author, title, price, publisher and stock position. Whenever a customer wants a book, the sales person inputs the title and author and the system searches the list and displays a suitable message if it is not available. If it is available, the system displays the book details and requests for the number of copies required. If the copies are available, the total cost of the copies requested is displayed, otherwise the message ‘copies not in stock’ is displayed. 
Design a system using a class called BOOKS with suitable member functions and constructors. Use new operator in constructors to allocate required memory space.



Posted by on

  • 3 more comments 
  • aumitav_17 Nov 21, 2008

    Yes, As early as possible

  • Anonymous Dec 13, 2008

    the code

  • rahulmatolia May 08, 2009

    1. Create a class FLOAT that contains one float data member. Overload all the four arithmetic operators so that they operate on the objects of FLOAT.

  • rahulmatolia May 08, 2009

    1. Write a C++ program to create a class called STRING and do the following operations. Show the results after every operation by overloading the operator <<. Use copy constructor.

    STRING s1 = “KUVEMPU”

    STRING s2 = “UNIVERSITY”

    STRING s3 = s1+s2

  • rahulmatolia May 08, 2009

    1. Using C++ , design and implement a class COMPLEX having the following functionality:a) allows representation of complex numbers
    b) allows addition of two complex numbers
    c) has overloading constructors and a copy constructor
    d) allows assignment of one complex number to another

×

2 Answers

  • Level 1:

    An expert who has achieved level 1.

    Corporal:

    An expert that has over 10 points.

    Mayor:

    An expert whose answer got voted for 2 times.

    Problem Solver:

    An expert who has answered 5 questions.

  • Contributor
  • 2 Answers

A book shop maintains the inventory of books that are being sold at the shop. The list has details like author, title, price, publisher and stock position. Whenever a customer wants a book, the sales person inputs the title and author and the system searches the list and displays a suitable message if it is not available. If it is available, the system displays the book details and requests for the number of copies required. If the copies are available, the total cost of the copies requested is displayed, otherwise the message ‘copies not in stock’ is displayed.
Design a system using a class called BOOKS with suitable member functions and constructors. Use new operator in constructors to allocate required memory space.

Posted on May 27, 2010

  • Level 1:

    An expert who has achieved level 1.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 1 Answer

I need answers of the above given questions..could i get theanswers plz???

Posted on Dec 24, 2009

2 Suggested Answers

  • 10406 Answers

SOURCE: Create a class called employee

Nice try!
Find an upper-class student that can give one-on-one tutoring with your homework.

Posted on Dec 02, 2009

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Create a base class called shapes. use this class t store two double type values that could be used to compute the area of figures.dreive two specific classes called triangle and rectangle from the base...


Calculate area of triangle and rectangle. Get the values from the area function that is calculated by both classes then display that area using your own class.

Sep 06, 2012 | Acer Computers & Internet

Tip

How to divide bandwidth in squid


What is Bandwidth throttling :

Consider we are having 512Kbps Internet connection line. And the system administrator wants to divide the whole bandwidth into two sections. Read More One for the normal users and the other for special users who need high speed internet connection. So that all the normal users can use 256 Kbps and the special users can use the remaining 256 Kbps. So in this case you have to make a bandwidth throttling to differentiate the whole single pipe line into two sections. This can be achieved using squid proxy server.

Squid main configuration file ----- /etc/squid/squid.conf
Squid log file ----- /var/log/squid/access.log
Cache log file ----- /var/log/squid/cache.log

Bandwidth throttling in squid is done using Delay Pools. Delay pools uses bucketing system.

Throttle Calculations
512Kbps(Kilo bits per second) -----> 64Kbytes -----> 64000bytes
256Kbps -----> 32Kbytes -----> 32000bytes
128Kbps -----> 16Kbytes -----> 16000bytes
64Kbps -----> 8Kbytes -----> 8000bytes

Points to remember in Delay Pools:
There are basically three things to note, they are - delay pools, delay class, delay parameters.

Delay pool --- Defines how many pools we want to use
Delay Class ---- Defines type of the pool you are going to use.
Delay Parameter � allots the restrictions and fill rate/maximum bucket size.

As I have said previously in this documentation delay pools uses bucketing system.
Now there are three types of buckets

Class 1 pool: A single aggregate bucket, shared by all users
Class 2 pool: One aggregate bucket, 256 individual buckets
Class 3 pool: One aggregate bucket, 256 network buckets, 65,536 individual buckets

If you still have any problem in the above syntax (ie) aggregate, network and individual buckets to understand, then here is a simple syntax/example for all these

For Class 1 delay pool
delay_parameters 1 32000/32000

For Class 2 delay pool
delay_parameters 1 48000/48000 48000/48000

For Class 3 delay pool
delay_parameters 2 32000/32000 8000/8000 16384/16384

Example Setup:
One 512Kbps pipe line. We want to distribute the whole pipe line into 2. One for normal users and other for special users as follows
Normal users --- 128 Kbps
Special Users --- 384 Kbps

Configuration Setup File /etc/squid/squid.conf:
Before getting into the delay pools setup first create the acl(Access Control List). Through acl you can define rules according to your requirements. Find the Access Control section in the squid.conf file.
Here is an example:

acl superusers src 192.168.1.1 192.168.1.2 192.168.1.3
acl mynetwork src 192.168.1.0/255.255.255.0

Here in the above example only three users are special users who need 256Kbps bandwidth which are listed in the specialusers label and the whole network including he special users are labeled as mynetwork.

After creating the users you have to allow them to access the internet. Below line specifies for allowing the mentioned labeled users.

http_access allow superusers
http_access allow mynetwork

Now comes the funny part Delay Pools. Here We will deal with a basic example for delay pools.

The example is as follows: We are having 512Kbps pipe line connection. We want to divide it into segments one for the special users, web servers and the other for the normal users in the organization. The special users and the web servers are given 384Kbps speed and the remaining 128Kbps for the normal users.

Delay Pools for super users:
Check for the delay pools section in the squid.conf file.
Start the configuration for delay pools as follows
==================================
########## Delay Pools############
==================================

delay_pools 2

As described above we have to create 2 delay pools, one for each delay class.
====================================================
######### Defining Delay pool 1 in class 2 #########
====================================================

delay_class 1 2
delay_parameters 1 48000/48000 48000/48000
delay_access 1 allow superusers

The first line specifies Delay Class which defines delay pool 1 for the delay class 2.

Why we are using delay class 2 here?

The first part on the second line ie �1� defines the pool One(1)

The second part on second line defines the aggregate 48000/48000(restore/max). where restore is the number of bytes (not bits - modem and network speeds are usually quoted in bits) per second placed into the bucket, and maximum is the maximum number of bytes which can be in the bucket at any time.

The third part on second line is individual buckets again 48000/48000(restore/max). All the special users and the web servers should obtain the same speed of 384 Kbps.

The third line allows the super users to fall in that bucket.

=====================================================
######### Defining Delay pool 2 in class 3 #########
=====================================================

Delay Pools for normal users:

delay_class 2 3
delay_parameters 2 32000/32000 8000/8000 16384/16384
delay_access 2 allow !superusers

The first line specifies Delay Class which defines delay pool 2 for the delay class 3.

The first part on the second line ie �2� defines the pool Two(2) of class three(3)

The second part on second line defines the aggregate 32000/32000(restore/max) as aggregate (ie for whole).
Note : - If you use -1/-1. �-1� indicates �unlimited�.

The third part on second line is network bucket. We have defined here 8000/8000 .

The fourth part on second line is for individual.

The third line specifies to throttle all the users except the super users.

How to check:
First set proxy settings in your browser as follows:
Go to any client machine and open an IE(Internet Explorer). Select "Tools" menu then select "Internet Options" then select "Connections" tab. After that select the "LAN Settings" button, you will get a new pop-up window there you select "Use proxy server for your LAN" check box and finally give your squid proxy servers ip address and the port on which the squid proxy server is configured. Now press "OK" and again press "OK". Cloase the window and now open a new window.
Second Check by downloading any large file

Start to download any lage file not less than 10MB size. Because when ever you download any small file it used to download it quickly. When you start downloading large file at first if you note some starting bytes of the file gets downloaded quickly and later it gets slowed down.

Keep a note on the download pop-up box which shows the speed limits in "kbps". When we start downloading note on the pop-up box the speed limits in kbps shows high value and then slowly gets decreased. This means when you start downloading the bucket gets filled and slowly it decreases and becomes stable to the specified limit in Kbps according to the configuration. Remember again as i told restore value is used to set the download speed, and the max value lets you set the size at which the files are to be slowed down from.

on Apr 24, 2010 | fedora Linux Operating System

1 Answer

What difference between genricServlet and httpServlet


public abstract class GenericServlet extends java.lang.Object implements Servlet, ServletConfig, java.io.Serializable
  • GenericServlet defines a generic, protocol-independent servlet.
  • GenericServlet gives a blueprint and makes writing servlet easier.
  • GenericServlet provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface.
  • GenericServlet implements the log method, declared in the ServletContext interface.
  • To write a generic servlet, it is sufficient to override the abstract service method.
javax.servlet.http.HttpServlet
Signature: public abstract class HttpServlet extends GenericServlet implements java.io.Serializable
  • HttpServlet defines a HTTP protocol specific servlet.
  • HttpServlet gives a blueprint for Http servlet and makes writing them easier.
  • HttpServlet extends the GenericServlet and hence inherits the properties GenericServlet.

May 12, 2011 | Computers & Internet

1 Answer

This is an illustration of use of classes in php please tell me do i need to put the classes in seperate php file and the objects in seperate file or in other words for the below example how many seperate...


Everything can be in the one file if you want, but that doesn't help with segregation of logic from the presentation layer (i.e. what you see on screen).

Personally I'd put my core class libraries in one or more files and include() them. And I'd probably put any extended classes in separate files and include() them additionally.

include ('library.class.php');
include ('extended.class.php');

Oct 14, 2009 | Computers & Internet

1 Answer

In cpp programming why do we go for abstract base class?


Virtual keyword allows the program to dynamically decide which function to call. That is, when derived class is inherited from a base class the function in derived class can perform a completely different action from the one in Base class. Hence the function call via a pointer or reference maps to different functions based on the type of the object.

Abstract base class is used, so that anyone who is inherting from this class should implement that interface. Because the base class may not have a meaningful implementation for that interface. For example to design a program for computing area of different shapes like rectangle, triangle, hexagon etc. base class can be thought of as Shape. In addition the base class can be made abstract by declaring Area to be a pure virtual function. Then the different shapes like Rectangle, Triangle classes can inherit from Shape and implement Area interface based on their formulae.

Apr 06, 2009 | Microsoft Computers & Internet

2 Answers

How can I create .jar file using jarmaker s/w.... (shahsani@ymail.com)


hi

Question How do I create a .JAR file?
Answer Java Archive (JAR) files allow developers to package many classes into a single file. JAR files also use compression, so this can make applets and applications smaller.
Creating a .JAR file is easy. Simple go to the directory your classes are stored in and type :-
jar -cf myfile.jar *.class If your application or applet uses packages, then you'll need to do things a little differently. Suppose your classes were in the package mycode.games.CoolGame - you'd change to the directory above mycode and type the following :- (Remember to use / on UNIX systems)
jar -cf myfile.jar .\mycode\games\CoolGame\*.class Now, if you have an existing JAR file, and want to extract it, you'd type the following
jar -xf myfile.jar Working with JAR files isn't that difficult, especially if you've used the unix 'tar' command before. If you're planning on packaging an applet for Internet Explorer, or an application for Microsoft's jview, you might also want to consider .CAB files.
'); document.write (''); document.write ('showle?'); //-->
hop i was helpfull good luck

Mar 14, 2009 | Microsoft Windows Vista Ultimate Edition

1 Answer

How can i connect the data base during my project


That seems fine.

I cant assume your level of confidence in programming, however, following are some simple steps you can follow to achieve (for complex implementations, much more time and details will be needed, i can help u with them as well)

1. Create a database in Access ( i assume u r using Access 2003)
2. Create a System DSN (if aren't clear, how to create then goto administrative tools under control panel and you'll find Data Sources (ODBC), here u need to create System level DSN for Access driver (may be Jet 4.0+)
3. In java, you need to import java core libraries for sql (javax.sql package specially)
4. you are almost done, just google for database code in java, simple code will be around 5-10 lines (just for your reference, search with these keywords, ClassName(""), jdbc:odbc:YourDSN)
5. Open a connection using Connection object
6. Fetch the records (select query) using Recordset object
7. You're done.

thanks
Kuldeep

Mar 13, 2009 | HP Computers & Internet

1 Answer

Binding SSL certificates using command line.


Hello!

As far as I know, there isn't an easy way of doing this. I've always just deployed certificates using the GUI interface of Internet Information Services. However, your question is a good one, and would be a very handy thing as systems that just run in the command line like Server 2008 in certain configurations run with better performance and less surface area. Great thinking! So I started looking around.

All I could find was the following article, which we know how to implement in the interface.

How to implement SSL or TLS secure communications

Pay close attention to paragraph 3, it looks like it hints towards a few different command line options. Then I found the article below.

IIS 6.0 Resource Kit Tools

IIS Cert Deploy VBS is the closest thing I can find to doing something like what you're describing. It looks like a sample file is included in the kit, and you may find some other options available to you as well in those command line executables included in the IIS kit.

That's the only information I can provide you with unfortunately! I wish I could give you more information because you raise a great point in being able to add a certificate within the command line. I searched around Microsoft knowledgebase articles for awhile and couldn't find anything related except for those links there. You can generate a certificate in the command line, I found a few articles on that, and I believe they mention it in the first link I gave you as well. But as far as implementing to a certain site, that seems to be the part where an interface is required unless that VBS script does anything for you.

Best of luck!

Feb 12, 2009 | Microsoft Windows Server Standard 2003 for...

1 Answer

Creating a ring using two circles in c++ program


Nice try!

If nobody has helped you since September 2008, when you asked the question, you probably scored a "zero" in your computer-programming course, and probably don't need an answer to your "homework" assignment.

Sep 15, 2008 | Computers & Internet

1 Answer

Java


Hello Sir,


The Spring Framework (or Spring for short) is an open source application framework for the Java platform. The first version was written by Rod Johnson, who first released it with the publication of his book Expert One-on-One J2EE Design and Development (Wrox Press, October 2002). A port is available for the .NET Framework.[1]
The framework was first released under the Apache 2.0 license in June 2003. The first milestone release, 1.0, was released in March 2004, with further milestone releases in September 2004 and March 2005.
Although the Spring Framework does not enforce any specific programming model, it has become popular in the Java community as an alternative, replacement, or even addition to the Enterprise JavaBean model. By design, the framework offers a lot of freedom to Java developers yet provides well documented and easy-to-use solutions for common practices in the industry.
While the core features of the Spring Framework are usable in any Java application, there are many extensions and improvements for building web-based applications on top of the Java Enterprise platform. Spring has gained a lot of popularity because of this, and is recognized by vendors as a strategically important framework.



The Spring Framework provides solutions to many technical challenges faced by Java developers and organizations wanting to create applications based on the Java platform. Because of the sheer vastness of the functionality offered, it can be hard to distinguish the major building blocks from which the framework is composed. The Spring Framework is not exclusively linked to the Java Enterprise platform, although its far-reaching integration in this area is an important reason for its popularity.
The Spring Framework is probably best known for offering features required to create complex business applications effectively outside of the programming models which have been dominant historically in the industry. Next to that, it is also credited for introducing previously unfamiliar functionalities into today's mainstream development practices, even beyond the Java platform.
This amounts to a framework which offers a consistent model and makes it applicable to most application types created on top of the Java platform today.
[Modules of the Spring Framework The Spring Framework can be considered as a collection of smaller frameworks. Most of these frameworks are designed to work independently of each other yet provide better functionalities when used together. These frameworks are divided along the building blocks of typical complex applications:
  • Inversion of Control container: configuration of application components and lifecycle management of Java objects.
  • Aspect-oriented programming framework: working with functionalities which cannot be implemented with Java's object-oriented programming capabilities without making sacrifices.
  • Data access framework: working with relational database management systems on the Java platform using JDBC and Object-relational mapping tools providing solutions to technical challenges which are reusable in a multitude of Java-based environments.
  • Transaction management framework: harmonization of various transaction management API's and configurative transaction management orchestration for Java objects.
  • Model-view-controller framework: HTTP and Servlet based framework providing many hooks for extension and customization.
  • Remote Access framework: configurative RPC-style export and import of Java objects over computer networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP).
  • Authentication and authorization framework: configurative orchestration of authentication and authorization processes supporting many popular and industry-standard standards, protocols, tools and practices via the Acegi sub-project.
  • Remote Management framework: configurative exposure and management of Java objects for local or remote configuration via JMX.
  • Messaging framework: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS API's.
  • Testing framework: support classes for writing unit tests and integration tests.

Mar 11, 2008 | Microsoft Windows XP Professional With...

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

1,690 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

joecoolvette
joecoolvette

Level 3 Expert

5660 Answers

kakima

Level 3 Expert

98694 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...