answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

How do you write a working key listener in java that responds to an 'enter'?

Almost all controls' ActionListener triggers the actionPerformed upon the enter key press == == Using an anonymous class implementation: Component c; // this is the component you want to add a listener to c.addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) { if(e.getKeyChar() == e.VK_ENTER) { // put the code you want to execute when Enter is pressed here System.out.println("ENTER PRESSED"); } } // unused abstract methods public void keyTyped(KeyEvent e) {} public void keyReleased(KeyEvent e) {} });


Swapping of two numbers using function overloading in c plus plus?

#include #include void swap(int &ix,int &iy); void swap(float &fx,float &fy); void swap(char &cx,char &cy); void main() { int ix,iy; float fx,fy; char cx,cy; clrscr(); coutix>>iy; coutfx>>fy; coutcx>>cy; cout


Develop a mark sheet in C plus plus for the university examination by using any form of constructors?

#include<iostream.h> class student { char name[10]; int rollno; public: void get() { cout<<"enter student's name"<<endl; cin>>name; cout<<"enter student's rollno"<<endl; cin>>rollno; } void disp() { cout<<"Name of the student is : "<<name<<endl; cout<<"Rollno is : "<<rollno<<endl; } }; class marks:public student { char subjectname[15]; int subcode,intmarks,extmarks; public: void get() { student::get(); cout<<"enter subject name"; cin>>subjectname; cout<<"enter subject code"; cin>>subcode; cout<<"enter Internal marks"; cin>>intmarks; cout<<"enter External marks"; cin>>extmarks; } void disp() { student::disp(); cout<<"Subject name is : "<<subjectname<<endl; cout<<"Subject code is : "<<subcode<<endl; cout<<"Internal marks : "<<intmarks<<endl; cout<<"External marks : "<<extmarks<<endl; } }; void main() { marks m; m.get(); m.disp(); }


Write a function that accept 5 digit number and return the sum of it to main?

#include<stdio.h> #include<conio.h> int func(void); void main(void) { clrscr(); printf("Enter five digit number: "); printf("nnnSum of entered number is %d",func()); getch(); } int func(void) { int b=0,a; while((a=getche())!='r') b+=a-=48; return b; }


C progamme for conversion of Celsius to Fahrenheit using array?

main void void void (void) { float temp1 [13]= {1,4,2,3,4,5,7,88,9,4,3,23,12};