Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

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,
DOB,
Team_name,
Batting_average

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.

2180_Tree.jpg

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

739_Tree_1.jpg

Programming Language, Programming

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

Have any Question? 


Related Questions in Programming Language

Wite a method to computer the following series mi 12 23

Write a method to computer the following series: m(i) = 1/2 + 2/3 + . . . + i/i + 1 Write a test program that displays the following table: I m(i) 1 0.5000 2 1.1667 . . . 19 16.4023 20 17.3546 Formulas to achieve the abo ...

Derive a class programmer from employee supply a

Derive a class Programmer from Employee. Supply a constructor Programmer Exercise 1: Derive a class Programmer from Employee. Supply a constructor Programmer (string name, double salary) that calls the base-class constru ...

Using the machine model find the minimum initiation

Using the machine model, find the minimum initiation interval and a uniform schedule for the iterations, for the following loop: for(i =1; i A[i] = B[i-1] + 1; B[i] = A[i-1] +2; } Remember that the counting of iterations ...

Generate code for the following three-address statements

Generate code for the following three-address statements assuming stack allocation where register SP points to the top of the stack. call p call q return call r return return

Programming assignmentthis question has two parts a and

Programming Assignment This question has two parts (a) and (b): Develop a program to read in five exam-scores (in the range of 0-100) of a student in HIST220 class. (a) You program should compute and store in memory the ...

Create a very basic calculator map out the numeric keypad

Create a very basic calculator, map out the numeric keypad (17 buttons) and an EditText view. If text is given, prompt the user with a message that complains about the error. Toast.makeToast(getApplicationContext() , "er ...

Assignmentjason has opened a coffee shop at the beach and

Assignment Jason has opened a coffee shop at the beach and sells coffee in three sizes: small (9oz) medium (12oz) and large (15oz). Small cost is $1.75 medium costs $1.90 and large costs $2.00. Write a menu driven progra ...

Write a program where you create a class called bankaccount

Write a program where you create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two const ...

Write an abstract superclass encapsulating a vacation a

Write an abstract superclass encapsulating a vacation: A vacation has two attributes: a budget and a destination. It has an abstract method returning by how much the vacation is over or under budget. This class has two n ...

Assignmentscenariosummaryin this lab you will create one

Assignment Scenario/Summary In this lab, you will create one project that reads from a file, one project that writes to a file, and one project drawing a snowman. Program files for each of the following programs. Write o ...

  • 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