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

Q1:

Write a Program in C++ which completes following requirements:

a. Create a class, having a static function printing some information 

and invoke that method using scope resolution operator.

b. Try to access non-static data members from static method and 

write in comments what happens.

c. Declare and initialize a static variable as counter in a function

(increment it in every call) and call it multiple times printing the 

change in value

d. Write about your observations while making this assignment in a 

word file about static variables and static methods.


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



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


Write a program that is able to compute some operations on an integer. The program writes the value of the integer and writes the following menu :

1. Add 1

2. Multiply by 2

3. Subtract 4

4. Quit



Code a program to get the number of students and the group size from the user. Calculate and display the number of groups that must be used to divide the students in the given group size. The last group would possibly not be filled. Display also the number of students in the last group.


Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working.

  • Describe each possibility in your own words.
  • Define "precondition" and "postcondition" as part of your description.
  • Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.

C++ Program to Add Complex Numbers by Passing Structure to a Function

What is the definition of precondition and post condition statement


i need help on assignment 3 chatbot for computer science


Rearrange Numbers in String

Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with decimal part.

Input

The input will be a single line containing a string.

Output

The output should be a single line containing the modified string with all the numbers in string re-ordered in decreasing order.

Explanation

For example, if the given string is "I am 5 years and 11 months old", the numbers are 5, 11. Your code should print the sentence after re-ordering the numbers as "I am 11 years and 5 months old".

Sample Input

I am 5 years and 11 months old

Sample Output

I am 11 years and 5 months old




The purpose is to create Circle and Triangle class by inheriting the Shape Class. Both the inherited classes should override the WhoamI() method of the Shape Class. The code has some bugs. Identify the Bugs and fix them.


public class Shape

{

private void WhoamI()

{

Console.WriteLine("I m Shape");

}

}

class Triangle : public Shape

{

public virtual void WhoamI()

{

Console.WriteLine("I m Triangle");

}

}

public class Circle : public Shape

{

void WhoamI()

{

Console.WriteLine("I m Circle");

}

}

class Program

{

static void Main(string[] args)

{

Shape s; s = new Triangle();

s.WhoamI();

s = new Circle();

s.WhoamI();

Console.ReadKey();

}

}


LATEST TUTORIALS
APPROVED BY CLIENTS