Ask Question, Ask an Expert


Ask Programming Language Expert

problem1)a) prepare a program that fills a matrix as follows:

• Both diagonal elements as 1’s .

• Rest of the elements as 0’s

The program should display the contents of the matrix using not more than two printf  statements.

b) Define a structure called "Cricket" that will describe the following information:

Player _name,

where DOB is itself another structure which have the members Date, Month, Year. Using cricket declare an array “player” with 10 elements and prepare a program to read the information about all the 10 players and print a team-wise list containing names of players, their DOB and batting average.

problem2)a) If m and n have been declared as integers and p1 and p2 as pointers to integers, then state errors, if any, in the following statements:

i) p1=&m;

ii) p2=n;

iii) *p1=&n;

iv) p2=&*&m;

v) m=p2*p1;

vi) p1=&p2;

vii) m=p1*+p2*++;

b) prepare a program that reads a file containing integers and appends at its end the sum of all the integers. The file name is supplied in the command line.

problem3)a) How will you represent the following arrays as a sparse array using vector representation?

0 2 0 0 0 0 0
4 0 0 0 0 0 1
0 0 0 0 0 5 0
0 0 0 1 3 0 0
0 8 0 0 0 0 0
7 0 0 0 0 0 0
0 0 6 0 0 2 0

b) Convert the expression 2+3-5/7 * 8+4/5 into RPN . Evaluate it in RPN notation.

problem4)a) Modify the function “ add _term” given at page 35 of Block 3 so that after adding a term to the existing polynomials no term have zero coefficient.

b) Traverse the tree given below in preorder, inorder and postorder.


c) Check whether the following tree is complete or not.


Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92600

Have any Question? 

Related Questions in Programming Language

Lab 1a box of cookies can hold 24 cookies and a container

Lab 1 A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies, the number of cookies in a box, and the number of cook ...

Note that these regular expressions give all of the

Note that these regular expressions give all of the following symbols (operator characters) a special meaning: \ " . - $ [ ] * + ? { } | / Their special meaning must be turned off if they are needed to represent them-sel ...

Write a program that creates a picture of a mountain

Write a program that creates a picture of a mountain panorama from a height profile entered by the user. The following screenshot shows what the output could look like: The picture shall consist of 5 text lines of length ...

Create a class named order that performs order processing

Create a class named Order that performs order processing of a single item. The class has the following five fields: Customer name Customer number Quantity ordered Unit price Total price Include set and get methods for e ...

Assignmentstep 1create a class named account with data

Assignment Step 1: Create a class named Account with data fields for an account number, payment amount and balance as well as the appropriate set and get methods. Include a constructor method that contains no arguments. ...

Question 1what is overriding please use code to explain it

Question 1: What is overriding? Please use code to explain it. (Cannot use the same code in class) Question 2: What are the benefits when inheritance is used if multiple classes share the same fields and methods? Questio ...

Assignmentinstructionsthe first programming project

Assignment Instructions The first programming project involves writing a program that computes the salaries for a collection of employees of different types. This program consists of four classes. The first class is the ...

The car classdefine a class called car that implements the

The Car Class Define a class called "Car" that implements the parameterized Comparable interface. Each object of this class represents a type of car. Your class must provide all the methods in the public interface. Be su ...

Sum of digits in a string design a program that asks the

Sum of Digits in a String Design a program that asks the user to enter a string containing a series of single digit numbers with nothing seperating them. The program should display the sum of all the single digit numbers ...

A software company microoffice has produced four

A software company MicroOffice has produced four generations of Word Processing Applications, called Word90, Word00, Word10, and Word15. Suppose you are writing a program to test their GUIs. The GUI components we are int ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen