Skip to main content

Posts

Showing posts from 2016

function solution

1. // to find areas using functions.using switch import java.io.*; class m1 { double area(double r) {   return(3.14*r*r); } int area(int s) {   return(s*s); } double area(double l, double b) {   return(l*b); } public static void main(String args[]) throws IOException {   m1 ob= new m1(); double p; int q; double w; BufferedReader input= new BufferedReader(new InputStreamReader(System.in)); System.out.println("*** MAIN MENU ***"); System.out.println("1. Area of Circle"); System.out.println("2. Area of Square"); System.out.println("3. Area of Rectangle"); System.out.println("4. Exit"); System.out.println("Enter Choice(1-4)"); int ch=Integer.parseInt(input.readLine()); switch(ch) { case 1: System.out.println("Enter the radius"); double r=Double.parseDouble(input.readLine()); p=ob.area(r); System.out.println("Area of Circle"+p); brea...
Sri Aurobindo Public School, Baddi CLASS XII: Test-1 Topic : Class and Objects/Constructor and destructor 1.  Write   the output of the following C++ program code                                      3 Note  :  Assume all required header   files are already being    included in the program. class   Eval { Char   Level; int Point; public: Eval(){Level=’E’;Point=0;} void Sink(int L) {   Level-   =L;   } void Float(int L) {    Level+=L   ; Point++;    } void   Show() {   cout<<Level<<”#”<<Point<<endl;  ...