VARIABLE, OPERATOR AND EXPRESSION [SET 1]

Similar documents
Subject: Computer Science

Chapter 1. Computer Overview

PROGRAMMING IN C AND C++:

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

Downloaded from

Suggestive List of C++ Programs

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview

Tribhuvan University Institute of Science and Technology 2065

Practical List of. MCA IV SEM Session -2010

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ).

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

BCA-105 C Language What is C? History of C

***********PYTHON PROGRAMS FOR CLASS XI ******************** """ Program to Calculate Simple Interest """ p = eval(input("enter Principle?

(i) Describe in detail about the classification of computers with their features and limitations(10)

The Hyderabad Public School, Begumpet, Hyderabad, A.P

m) sin() n) endl o) getch() p) cout

Sorting is ordering a list of objects. Here are some sorting algorithms

Guru Gobind Singh Public School Sector V,B Bokaro Steel City Annual IP Assignment Class 11

Chapter 3 Problem Solving and the Computer

EASY

CHAPTER 4 FUNCTIONS. Dr. Shady Yehia Elmashad

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary.

Computer Engineering 1 (1E3)

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

DR. A.P.J. ABDUL KALAM TECHNICAL UNIVERSITY LUCKNOW. Evaluation Scheme & Syllabus. For. B.Tech. First Year (Programming for Problem Solving)

Computer Science 330 Assignment

[6] [6] [6] [5] [5] [6] [5] [5]

List of Practical for Class XII Computer Science

Questions Bank. 14) State any four advantages of using flow-chart

Lab Manual. Program Design and File Structures (P): IT-219

Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm

CLASS 8 (Mathematics) -EM

Math 7 Glossary Terms

Lab 1. largest = num1; // assume first number is largest

DIOCESAN COLLEGE PREPARATORY SCHOOL Mathematics Syllabus: Grade 7

KENDRIYA VIDYALYA CLRI CHENNAI AUTUMN BREAK HOLIDAY HW MARKS QUESTIONS : DATA STRUCTURE

CHAPTER 4 FUNCTIONS. Dr. Shady Yehia Elmashad

1. Wap in JAVA to accept two values and calculate highest value and lowest value.

4. Use a loop to print the first 25 Fibonacci numbers. Do you need to store these values in a data structure such as an array or list?

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

COMPUTER APPLICATIONS

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

Mental Maths Competition Topics Included. (1) Q. No. 1 to 50 are based on basic. Calculation questions related to Addition,

Integer Operations. Summer Packet 7 th into 8 th grade 1. Name = = = = = 6.

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition)

Sample Paper Class XI Subject Computer Sience UNIT TEST II

Object Oriented Programming Using C ++ Page No. : 1. ASSIGNMENT SHEET WITHOUT USING OBJECT AND CLASSES

Savitribai Phule Pune University, Pune Second Year of Computer Engineering (2015 Course) : Object Oriented Programming Lab Teaching Scheme

COMPUTER SCIENCE (083)

Montana City School GRADE 5

ALIGARH MUSLIM UNIVERSITY Department of Computer Science. JAVA Lab Assignment Course: MCA II nd Semester Academic Session:

Write a java program to prints the count of odd and even no s entered.

Kadi Sarva Vishwavidyalaya, Gandhinagar

SUMMER REVIEW PACKET 2 FOR STUDENTS ENTERING ALGEBRA 1

Object Oriented Programming 2012

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

ANNA UNIVERSITY: CHENNAI B.E./B.Tech. DEGREE EXAMINATIONS, JAN Regulations First Semester (Common to All Branches )

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

CSci 1113, Fall 2015 Lab Exercise 4 (Week 5): Write Your Own Functions. User Defined Functions

Mathematics Stage 4 Diagnostic Tasks Answers with Common Errors

3 The L oop Control Structure

Florida Math 0018 Correlation of the ALEKS course Florida Math 0018 to the Florida Mathematics Competencies - Lower

Module Contact: Dr Pierre Chardaire, CMP Copyright of the University of East Anglia Version 1

INDEX. Sl. No. Programs Page No. Procedure 2. 1 To check whether person is eligible for vote or not. 2 To find the given number is even or odd 6-8

Functions. Arash Rafiey. September 26, 2017

CSCE 2014 Final Exam Spring Version A

x= suppose we want to calculate these large values 1) x= ) x= ) x=3 100 * ) x= ) 7) x=100!

RBI PHASE 1 RECAP 2 ND JULY 18 QUANT NUMBER SYSTEM

UNIT- 3 Introduction to C++

Alignment to the Texas Essential Knowledge and Skills Standards

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake

[Page 177 (continued)] a. if ( age >= 65 ); cout << "Age is greater than or equal to 65" << endl; else cout << "Age is less than 65 << endl";

Foundation. Scheme of Work. Year 9. September 2016 to July 2017

Programming in OOP/C++

KLiC C Programming. (KLiC Certificate in C Programming)

VALLIAMMAI ENGINEERING COLLEGE

CLASS - VII PROJECTS IN MATHEMATICS ASSIGNING PROJECTS TEACHER S ROLE

VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS

Programming in C++ The manager of a company. Lecture Notes 6. Functions (Procedures) 4/24/2018. he he he. Does Does Does

C++ PROGRAMMING SKILLS Part 4: Arrays

Math 100 Exam 1 Review Name. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

(Practice Worksheet) MATHEMATICS

i) Natural numbers: Counting numbers, i.e, 1, 2, 3, 4,. are called natural numbers.

APS Seventh Grade Math District Benchmark Assessment NM Math Standards Alignment

Objectives/Outcomes. Introduction: If we have a set "collection" of fruits : Banana, Apple and Grapes.

Mathematics. Grade 8 Curriculum Guide. Curriculum Guide Revised 2016

2 + (-2) = 0. Hinojosa 7 th. Math Vocabulary Words. Unit 1. Word Definition Picture. The opposite of a number. Additive Inverse

Module 7 Highlights. Mastered Reviewed. Sections ,

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

Matrices. A Matrix (This one has 2 Rows and 3 Columns) To add two matrices: add the numbers in the matching positions:

Question Bank (SPA SEM II)

LECTURE 17. Array Searching and Sorting

END TERM EXAMINATION

ARRAY FUNCTIONS (1D ARRAY)

2017 Four-by-Four Competition Thursday, February 2nd, Round Four-by-Four Competition Thursday, February 2nd, 2017.

Number Algebra Geometry and Measure Statistics. Aspect 1 Aspect 2 Aspect 3 Aspect 4 Work out the upper. Calculate area of and lower bounds of

2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them.

Full file at

Transcription:

VARIABLE, OPERATOR AND EXPRESSION Question 1 Write a program to print HELLO WORLD on screen. Write a program to display the following output using a single cout statement. Subject Marks Mathematics 90 Computer 77 Chemistry 69 Question 7 Question 10 Write a program which accept two numbers and print their sum. Write a program which accept temperature in Fahrenheit and print it in centigrade. Write a program which accept principle, rate and time from user and print the simple interest. Write a program which accepts a character and display its ASCII value. Write a program to swap the values of two variables. Write a program to calculate area of circle. Write a program to check whether the given number is positive or negative Write a program to check whether the given number is even or odd

Question 1 Question 7 Question 10 Question 11 Question 12 FLOW OF CONTROL Any integer is input by the user. Write a program to find out whether it is an odd number or even number. Find the absolute value of a number entered by the user. Write a program to calculate the total expenses. Quantity and price per item are input by the user and discount of 10% is offered if the expense is more than 5000. Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user. If the ages of Ram, Sulabh and Ajay are input by the user, write a program to determine the youngest of the three. Write a program to check whether a triangle is valid or not, when the three angles of the triangle are entered by the user. A triangle is valid if the sum of all the three angles is equal to 180 degrees. Any year is input by the user. Write a program to determine whether the year is a leap year or not. In a company an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input by the user write a program to find his gross salary. Write a program to calculate the monthly telephone bills as per the following rule: Minimum Rs. 200 for upto 100 calls. Plus Rs. 0.60 per call for next 50 calls. Plus Rs. 0.50 per call for next 50 calls. Plus Rs. 0.40 per call for any call beyond 200 calls. Write a program to find the roots of and quadratic equation of type ax2+bx+c where a is not equal to zero. The marks obtained by a student in 5 different subjects are input by the user. The student gets a division as per the following rules: Percentage above or equal to 60 - First division Percentage between 50 and 59 - Second division Percentage between 40 and 49 - Third division Percentage less than 40 - Fail Write a program to calculate the division obtained by the student. Any character is entered by the user; write a program to determine whether the character entered is a capital letter, a small case letter, a digit or a special symbol. The following table shows the range of ASCII values for various characters. Characters ASCII Values A Z 65 90 a z 97 122 0 9 48 57 special symbols 0-47, 58-64, 91-96, 123 127

LIBRARY FUNCTIONS Question 1 Write a program which input principal, rate and time from user and calculate compound interest. You can use library function. CI = P(1+R/100) T P Write a program to compute area of triangle. Sides are input by user. Area = sqrt(s*(s-a)*(s-b)*(s-c)) where s=(a+b+c)/2. Write a program to check character entered is alphabet, digit or special character. Write a program which displays a number between 10 to 100 randomly. Write a program which accept a letter and display it in uppercase letter. Write a C++ program to implement the Number Guessing Game. In this game the computer chooses a random number between 1 and 100, and the player tries to guess the number in as few attempts as possible. Each time the player enters a guess, the computer tells him whether the guess is too high, too low, or right. Once the player guesses the number, the game is over.

Question 1 USER DEFINED FUNCTION Write a program using function which accept two integers as an argument and return its sum. Call this function from main( ) and print the results in main( ). Write a function to calculate the factorial value of any integer as an argument. Call this function from main( ) and print the results in main( ). Write a function that receives two numbers as an argument and display all prime numbers between these two numbers. Call this function from main( ). Raising a number to a power p is the same as multiplying n by itself p times. Write a function called power that takes two arguments, a double value for n and an int value for p, and return the result as double value. Use default argument of 2 for p, so that if this argument is omitted the number will be squared. Write the main function that gets value from the user to test power function. Write a function called zero_small() that has two integer arguments being passed by reference and sets the smaller of the two numbers to 0. Write the main program to access the function. Write the output of the following program : #include <iostream.h> void X(int &A, int &B) A = A + B; B = A - B; A=A-B; int a = 4, b =18; X(a,b); cout<<a<<, <<b;

Question 7 Write the output of the following program: #include <iostream.h> void X(int A, int &B) A = A+B; B = A-B; A = A-B; int a=4, b=l8; X(a,b); cout<< a <<, <<b; Write the output of the following program: void Execute(int &B, int C=100) int TEMP = B + C; B += TEMP; if (C == 100) cout<<temp<<" "<<B<<" "<<C<<endl; int M= 90, N = 10; Execute(M); cout << M << << N << endl; Execute(M,N); cout << M<< "<<N<< endl; Give the output of the following program int global = 10; void func(int &x, int y) x = x - y; y = x * 10; cout << x << << y << '\n'; int global = 7: func (::global, global); cout << global <<, << ::global << \n ; func(global,:: global); cout<< global <<, <<::global<< \n ;

Question 10 Write the output of the following program : static int i=100; void abc() static int i=8; cout<< "first=" <<i++; main() static int i = 2; abc(); cout << "second = << i << endl; abc(); Question 11 Write the output of the following program: int func(int &x, int y = 10) if (x%y == 0) return ++x; else return y--; int p=20, q=23; q=func (p,q); cout << p << " " << " " << q << endl; p=func (q); cout<< p << " " << " " << q << endl; q=func (p); cout << p << " " << " " << q << endl;

Question 1 Question 7 Question 10 ARRAY-SINGLE DIMENSION Write a C++ program to find the sum and average of one dimensional integer array. Write a C++ program to swap first and last element of an integer 1-d array. Write a C++ program to reverse the element of an integer 1-D array. Write a C++ program to find the largest and smallest element of an array. Write a menu driven C++ program with following option a. Accept elements of an array b. Display elements of an array c. Sort the array using insertion sort method d. Sort the array using selection sort method e. Sort the array using bubble sort method Write C++ functions for all options. The functions should have two parameters name of the array and number of elements in the array. P is one-dimensional array of integers. Write a C++ function to efficiently search for a data VAL from P. If VAL is present in the array then the function should return value 1 and 0 otherwise. Suppose a one-dimensional array AR containing integers is arranged in ascending order. Write a user-defined function in C++ to search for an integer from AR with the help of Binary search method, returning an integer 0 to show absence of the number and integer 1 to show presence of the number in the array. Function should have three parameters : (i) array AR (ii) the number to be searched and (iii) the number of elements N in the array. Suppose A, B, C are arrays of integers of size M, N, and M + N respectively. The numbers in array A appear in ascending order while the numbers in array B appear in descending order. Write a user defined function in C++ to produce third array C by merging arrays A and B in ascending order. Use A, B and C as arguments in the function. Suppose X. Y, Z are arrays of integers of size M, N, and M + N respectively. The numbers in array X and Y appear in descending order. Write a user-defined function in C++ to produce third array Z by merging arrays X and Y in descending order. Given two arrays of integers A and B of sizes M and N respectively. Write a function named MIX () with four arguments, which will produce a third array named C. such that the following sequence is followed. All even numbers of A from left to right are copied into C from left to right. All odd numbers of A from left to right are copied into C from right to left. All even numbers of B from left to right are copied into C from left to right. All old numbers of B from left to right are copied into C from right to left. A, B and C are passed as arguments to MIX (). e.g., A is 3, 2, 1, 7, 6, 3 and B is 9, 3, 5, 6, 2, 8, 10 the resultant array C is 2, 6, 6, 2, 8, 10, 5, 3, 9, 3, 7, 1, 3