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

1 point

I have to read the string “What is your name?” into a variable x. Which of the following is the appropriate command sequence?


x; cin>>x;

 

char x; cin<<x;

 

string x; cin>>x;

 

char x; cin>>x;


Write a C++ program to sort a given array of integer numbers and also provide a function 

to search for a given element in that sorted array using binary search algorithm.


Consider the following lines of Python code.
x = [589,'big',397,'bash']
y = x[2:]
u = x
w = y
w = w[0:]
w[0] = 357
x[2:3] = [487]

Write a program which multiplies an N digit number M by a 1 digit number d, where N could be large, e.g. 1000. The input will be given as follows. First, the user gives d, then N and then the digits of M, starting from the least significant to the most significant. The program must print out the digits of the product one at a time, from the least significant to the most significant.

Hint: Mimic the process of manual multiplication. Keep track of the current carry in a variable and update it as you go along.


Write an expression that prints "Special number" if specialNum is 0, -99, or 44.


Fill in the blanks in the following code. The code is written to draw 4 rectangles of heights 20, 30, 40, 50 respectively and widths 20, 15, 10, 5 respectively. The centres of these rectangles are at (1,2)


initCanvas();

double x=20;

double y=20;

repeat(4){

Rectangle r( BLANK-P , BLANK-Q , x, y);

r.imprint();

x = x + BLANK-R ;

y = y + BLANK-S ;

}

What is BLANK-P ?



What is BLANK-Q ?



What is BLANK-R ?



What is BLANK-S ?



Write a program to calculate the SPI(semester performance index) and CPI(Cumulative Performance Index) of a student taking N courses in a semester. Each course has a specified weight, termed as credit and a student secures a letter grade in that course as per the Grading System.

The Grading System is as follows:

Letter Grade Numerical Grade

A 10

B 9

. .

. .

K 0

Note that the numerical grade can be obtained from the letter grade using arithmetic operations on char type data.


Create a simple mashup page that displays both the BBC news (https://www.bbc.com/news) and BBC Pidgin (https://www.bbc.com/pidgin) home pages. Your solution should be in a file p3.html. Note: your solution for this problem does not need to validate.


Bank ChargesA bank charges $10 per month plus the following check fees for a commercial check- ing account:$.10 each for fewer than 20 checks$.08 each for 20–39 checks$.06 each for 40–59 checks$.04 each for 60 or more checksThe bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied).Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank’s service fees for the month.
Input Validation: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.

 

View sample output




 


Write a program that converts the user's number into the desired unit of measurement. The user will pick the desired unit from a menu shown below. Ask the follow-up question (the number to convert) and do the math ONLY if the user picks a valid choice from the menu. You can see the conversions / multipliers needed for this program in the output section below. 

 

Menu/Prompt:

Enter the number that corresponds to your desired unit conversion from the choices below:

[1] Tablespoon (Tbsp) to Teaspoons (Tsp)

[2] Ounces (Oz) to Grams (g)

[3] Cups to Milliliters (ml)

Enter a number: 3

 

Possible Input/Output (Assume user enters the number 1 as the base unit)

 

Enter the number of tablespoons:

There are 3 teaspoons in 1 tablespoons

 

Enter the number of ounces:

There are 28.35 grams in 1 ounces

 

Enter the number of cups:

There are 236.6 ml in 1 cups

 

Invalid choice. Please run the program again.

 

Notes and Hints:

1) What programming structure is best for menus? Use that!

LATEST TUTORIALS
APPROVED BY CLIENTS