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

Hollow Full Pyramid - 2

Given the number of rows N, write a program to print the hallow full pyramid pattern similar to the pattern shown below.

   1 

   1 2 

  1   3 

1     4 

1 2 3 4 5


Q1. Determine the growth function and order of the following code fragment:

for (int count=0; count < n; count++)

{

for (int count2=0; count2 < n; count2=count2*2)

{

System.out.println(count, count2);

}

}





Q2. What is the order of the following growth functions?

a. 10n2 + 100n + 1000

b. 10n3 – 7

c. 2n + 100n3

d. n2 log n





Q3. Arrange the growth functions of Q4 in ascending order of efficiency for n=10 and again for n = 1,000,000
Problem 5: Write pseudocode of a program that takes a number that represents data_Type, another variable sign_Unsign to further classify the data type as signed or unsigned, and a number from the user. Verify if that number can be stored in that given data type. Range of each datatype is given in the table below.
Input:
1. Take data_Type from the user, if the user enters value other than 1 or 2 ask to input data_Type
again.
2. Take sign_Unsign from the user, if the user enters anyother value than 0 or 1 ask to input
sign_Unsign again 3. Take number (any)
1 – short int 0 - signed 2 byte 1 - unsigned 2 bytes 2-int 0-signed 4bytes 1 - unsigned 4 bytes
-32768 to 32767
0 to 65535
-2147483648 to 2147483647 0 to 4296967295
Data_Type
Sign_Unsign
Size
Range

Problem 5: Write pseudocode of a program that takes a number that represents data_Type, another

variable sign_Unsign to further classify the data type as signed or unsigned, and a number from the user.

Verify if that number can be stored in that given data type. Range of each datatype is given in the table

below.

Input:

1. Take data_Type from the user, if the user enters value other than 1 or 2 ask to input data_Type

again.

2. Take sign_Unsign from the user, if the user enters anyother value than 0 or 1 ask to input

sign_Unsign again

3. Take number (any)


Write a function that, when you call it, displays a message telling how many times it has been called: “I have been called 3 times”, for instance. Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use a global variable to store the count. Second, use a local static variable. Which is more appropriate? Why can’t you use a local variable? 


Write a function called swap() that interchanges two int values passed to it by the calling program. (Note that this function swaps the values of the variables in the calling program, not those in the function.) You’ll need to decide how to pass the arguments. Create a main() program to exercise the function.


Solve this problem using MATLAB RTB commands. No need to solve

manually.

4.1 Find the rotation matrix R, obtained by the ZYZ Euler Angles (30
Show Z = xy

Develop a program to read the namebirthday and gender of a person from a file and output the name and ten-digit national identity card (NIC) number to another file where each name is starting on a new line (see the example below). The only input to the program is the name of the file. The output of the programme is the file "output.txt". Below are the rules for forming the NIC number.

  • The first four digits of the ID card is the birth year.
  • The next three digits are the number of days to the birth date from January 1st of that year. If the person is a female, 500 is added to that value.
  • The next three digits are assigned in the order of submission for a particular birth year. 
  • The input file contains the records in the order of submission where each attribute is space-separated.
  • In the example given below, Aruni is the second entry in the year 1990. Therefore the last three digits of the NIC are 002.
  • Assume there are only 999 entries per year.

Create a product class with product name, stock balance and price as attributes. include a constructer method (_init_) and also include methods for show data, issue product and get discount. Issue product must update stock balance by reducing it by a given quantity. Get discount must calculate and return 10% of price as discount. In the main program create two product objects and pass messages.


LATEST TUTORIALS
APPROVED BY CLIENTS