C # Assignment

  • Uploaded by: Vijaiyesh Babu
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View C # Assignment as PDF for free.

More details

  • Words: 429
  • Pages: 2
Assignments : 1) Define two classes, one with a method to display the string”C sharp” and the other to display the string”programming”.Wruite a program using these classes to display a single line output as follows: “ C sharp programming”. 2) Write a program to perform the following tasks. a) Declare two variables x and y as float type variables. b) Declare m as integer variable c) Assign the values 75.86 to x and 43.48 to y d) Assign the sum of x and y to m e) Display the value of m 3) Write a program to read interactively two integer values using the methods Conole.ReadLine() and int.parse() and then display their . sum .difference .product .integer division .modulus division 4)Write a program that will read the value of x and evaluate the following function y= {1 for x>0 {0 for x=0 {-1 for x<0 using a) nested if statements b)else if statements, and c)conditional operator? 5) Write a program using a for that accepts five values in Us dollar,one at a time, and converts each value entered to its Indian rupees equivalent before the next value is requested. 6)Write a method that takes two int type value parameters and one int type out parameter and returns the product of two value parameter through the output parameter Write a program to test its working. 7) Write a program that accepts a shopping list of five items from the command line, stores them in string type array and then prints the list in alphabetical order. 8) Write a program that reads the name INDIRA GANDHI Into two separate string objects and then concentrates those into a new string using: a) +operator b) Append method 9) Design a structure type data using a suitable name for each of the following records: a) A student record consisting of name, date of birth, and total marks obtained. b) A mailing list consisting of name, door number, street, city and pin code. c) An inventory, record consisting of item code, item name, item cost and the total items available. d)A book record consisting of the author,title,year of publication and cost.

10) Define a base class called animal with following members: • A string type data member to store the name of the animal • An integer member to display the name and age of the animal Derive two classes named cat and dog from animal class.then write a driver program to create cat and dog objects with suitable values .display the contents of the objects by calling the display method on the derived objects.

Related Documents

Assignment C++
November 2019 13
C # Assignment
December 2019 24
C-lab-assignment-1
July 2020 8
Assignment+2 C++
May 2020 10
C++ Assignment 1.docx
April 2020 16
C Assignment Sheet
November 2019 12

More Documents from ""

C # Tutorial3
December 2019 23
C # Syllabus
December 2019 26
Text Book
December 2019 40
C # Tutorial2
December 2019 27
Delete Virus Steps
June 2020 19
Web Resources
December 2019 29