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

Ask user to enter three words. You can assume that each word has the maximum length of five characters. 


 Create a class product, take appropriate data members and functions which calculate net profit for a product after selling the product.


Create a class switchboard. Create a function that returns how many possible outcomes can come from a certain number of switches (on / off). In other words, for a given number of switches, how many different combinations of on and off can we have?


Given two dates D1 and D2, write a program to count the number of Saturdays and Sundays from D1 to D2 (including D1 and D2).

The date in string format is like "8 Feb 2021".Input


The first line of input will contain date D1 in the string format.

The second line of input will contain date D2 in the string format.Output


The output should be a single line containing two integers separated by space.Explanation


For example, if the given dates are "25 Jan 2021" and "14 Feb 2021", the Saturdays and Sundays dates from "25 Jan 2021" to "14 Feb 2021" are

"30 Jan 2021" is a Saturday

"31 Jan 2021" is a Sunday

"6 Feb 2021" is a Saturday

"7 Feb 2021" is a Sunday

"13 Feb 2021" is a Saturday

"14 Feb 2021" is a Sunday

So the output should be

Saturday: 3

Sunday: 3

Sample Input 1

25 Jan 2021

14 Feb 2021

Sample Output 1

Saturday: 3

Sunday: 3




Write a program that produces the following output using nested for loops.



****** ///////////// ******

***** ///////////\\ *****

**** /////////\\\\ ****

*** //////\\\\\\\ ***

** ////\\\\\\\\\ **

* //\\\\\\\\\\\ *

\\\\\\\\\\\\\ 


Q1.Define class Student with the following attributes and member functions.

i. Date of Birth (constant data member) ii. Pointer to char for name iii. Pointer to char for Department iv. Student ID (constant data member) v. Member function Constructors vi. Member function Destructor vii. Member function to modify state of the object viii. Member function to display state of the object (should be constant) Note that pointers in (ii) and (iii) should point to the dynamic memory allocated for name and Department name. Get information of the student object in constructor. Memory for name and Department will be allocated in constructor using dynamic memory allocation. Destructor will release memory to the operating system.

Q.3. Extend Q.2 for shallow and deep copy constructor


write a method called secondLargest that takes an array of integers and returns the second largest element in the array


write a method called insert that inserts an element into an integer array. It should take 3 parameters: an int array, the number to be inserted and the index it should be inserted at. It should return a new array that has the element inserted at the index (the new array should have a length 1 longer than the original array).


write two method called findIndex and findLastIndex that search for a number in an array. they should take an int array and an int as parameters. findIndex should return the index of the first instance of the number in the array. findLastIndex should return the index of the last instance of the number in the array. They both should return -1 if the number is not found. Do not use any library methods


Use method overriding to write two methods called printArray. On should take an int array and the other should take a double array. Both should print the array they are given as an argument


LATEST TUTORIALS
APPROVED BY CLIENTS