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

a)        Write code to create ‘Shape’ class and include following:             

  1. Create these private data members in Shape class: width (float), length (float), name (string)
  2. Create wrappers (getters/setters) for each data member
  3. Create a constructor that initialises data members and a destructor that outputs data members
  4. Create a copy constructor in the class and use it in main function
  5. Include meaningful composition in the Shape class and use it in main function

  


1.     A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is divisible only by 1 and n. For example, the integers 17 and 29 are prime, but 1 and 38 are not prime. Write a function named "is_prime" that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise. Thus, for example:


         cout << is_prime(19) << endl;    // will print 1

         cout << is_prime(1) << endl;     // will print 0

        cout << is_prime(51) << endl;   // will print 0

        cout << is_prime(-13) << endl; // will print 0

1.     Write a function named "sum_from_to" that takes two integer arguments, call them "first" and "last", and returns as its value the sum of all the integers between first and last inclusive. Thus, for example:


         cout << sum_from_to(4,7) << endl;  //will print 22 because 4+5+6+7 = 22

        cout << sum_from_to(-3,1) << endl; //will print -5 'cause (-3)+(-2)+(-1)+0 +1 = -5

        cout << sum_from_to(7,9) << endl;  //will print 22 because 7+8+9 = 24

        cout << sum_from_to(9,9) << endl;  //will print 9

Write a program in C++ to open and read the contents of the Text1.txt using the file stream class. Close the file and again open to update the contents of given file Text1.txt. Text1.txt : I am enjoying learning OOPS concepts After update Text1.txt: I am enjoying learning OOPS concepts Now learnt C++; Java is my next target.


create a program that should ask a user input either 0 (tails) or

1 (heads). Then the program will draw a coin flip. The program will declare the

user a winner if the result of the coin flip is equal to the user input. If the

user enters a value outside the given choices, it will display invalid choice.


Explain with an example how one user defined data type can be converted to a predefined data type. 


. Write a program to perform binary operator overloading for a class named "data". The details of operators to be overloaded are:


+ will subtract the numbers


- will divide the numbers


*will add the numbers


/ will multiply the numbers


 Write a program to permanently store the data entered by the user. When user is done with Input, then print the confirmation message as "Content saved successfully" along with the number of character stored. 



A security company/Ambulance Service/Fire Service/Police Service wishes to optimally place vehicles in an area such that the response time to any given call within the area is reached within a given time. It also wishes to find the optimal number of security patrol cars to be deployed within the given area. Use a computational geometric approach to develop a code that receives the alarm/homes points, the targeted time to reach the alarm/home and the average speed of cars within the area and identifies where the vehicles can be optimally placed and also determines the number of vehicles required. The alarm/call points (x1, y1), (x2, y2), ..., (xn, yn) are stored in vectors X = [x1, x2, ..., xn], Y = [y1, y2, ..., yn]. Clearly state your assumptions.


Write a program to implement the following operations (the ones mentioned in comments) on Matrix. The main() function of the above program is as below:


LATEST TUTORIALS
APPROVED BY CLIENTS