logging in or signing up Java programs questions sancharid Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 139 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: October 27, 2010 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Slide 1: Questions on Programming Slide 2: Design a class change to convert a decimal number to its equivalent in base 16 and to convert it back to its decimal form.eg i) The decimal number 35 is 23 in base 16 ii) the decimal number 107 is 6B in base 16. Some of the members of the class are given below Class name : change Data members/member variables a[] :integer type array Slide 3: n :integer to be converted to base 16 Member functions/methods change () :constructor to assign 0 to instance variable void input() :accept integer to be converted to base 16 void hexdeci(int) :to convert decimal integer ‘n’ to hexadecimal form void decihexa( ) : to convert hexadecimal number back to decimal form Specify the class change giving details of the constructor and the functions void input( ), void hexdeci(int) and void decihexa( ).The main function need not be written. Slide 4: A class Hifact has been defined to find the HCF of two numbers using the Recursive technique .This HCF is used to find the LCM of the two numbers. Some members of the class are given below: Class name : Hifact Data members/member variables a,b, hcf,lcm : integers Member functions/methods Hifact( ) : Constructor to assign initial values to the data members . Slide 5: Member functions/methods Hifact( ) : Constructor to assign initial values to the data members . void getdata() : to input values of a,b void change( ) :to swap a and b id a>b int rehcf(int,int) : to find hcf using recursive technique int fn_lcm(int,int,int) : to find lcm using a,b,hcf void result( ) : to invoke rehcf( )and fn_lcm() and to to print lcm, hcf of two numbers a,b Specify the class Hifact giving the details of constructor ,void getdata (),void change(), int rehcf() and int fn_lcm().Write the main function and find the hcf and lcm of any two integers ,a and b. Slide 6: Sum= 1+x/1! + x3/2! + x5/3! + ………+ x2n-1/n! A class sum series has been defined to calculate sum of the above series. Some of the members of the class are given below. Class name : sumseries Data members/member variables x,n :(integer) Sum : double Member functions/methods sumseries() : constructor int factorial(int n) : calculates and returns factorial of n double term(int p, int q) :Calculates and returns the value of p/q! by making use of factorial(int) Slide 7: void accept() : inputs the value of member data x,n void displaysum() : Displays the value of member data sum double calsum( ) : Calculates the sum of the given series using the appropriate data and other member function Specify the class sumseries giving details of the constructor and all the method.You do not need to write the main function . Slide 8: A class recursion has been defined to find the Fibonacci series upto a limit. Some of the members of the class are given below. Class name : recursion Data members/member variables a,b,c,limit : all integers Member functions/methods recursion( ) : constructor to assign a,b,c with the appropriate values. Slide 9: void input( ) : to accept the limit of the series int fib(int n) : to return the nth Fibonacci term using recursive technique void generate_fibseries ( ) : to generate Fibonacci series upto the given limit. Specify the class recursion giving the details of the constructor and other functions. Slide 10: A class called number has been defined to find the frequency of each digit present in it and the sum of the digits and to display the results . Some of the members of the class are given below. Class name :number Data members/member variables num : long integer type Member functions/methods number() : constructor to assign 0 to num number(long n) : constructor to assign n to num Slide 11: void digit_frequency() : to find the frequency of each digit and to display it. Int sum_digit( ) : to return the sum of the digits of the numbers Specify the class number giving the details of the two constructors and functions void digit_frequency( ) and int sum_digit( ).You do not need to write the main function. You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
Java programs questions sancharid Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 139 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: October 27, 2010 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Slide 1: Questions on Programming Slide 2: Design a class change to convert a decimal number to its equivalent in base 16 and to convert it back to its decimal form.eg i) The decimal number 35 is 23 in base 16 ii) the decimal number 107 is 6B in base 16. Some of the members of the class are given below Class name : change Data members/member variables a[] :integer type array Slide 3: n :integer to be converted to base 16 Member functions/methods change () :constructor to assign 0 to instance variable void input() :accept integer to be converted to base 16 void hexdeci(int) :to convert decimal integer ‘n’ to hexadecimal form void decihexa( ) : to convert hexadecimal number back to decimal form Specify the class change giving details of the constructor and the functions void input( ), void hexdeci(int) and void decihexa( ).The main function need not be written. Slide 4: A class Hifact has been defined to find the HCF of two numbers using the Recursive technique .This HCF is used to find the LCM of the two numbers. Some members of the class are given below: Class name : Hifact Data members/member variables a,b, hcf,lcm : integers Member functions/methods Hifact( ) : Constructor to assign initial values to the data members . Slide 5: Member functions/methods Hifact( ) : Constructor to assign initial values to the data members . void getdata() : to input values of a,b void change( ) :to swap a and b id a>b int rehcf(int,int) : to find hcf using recursive technique int fn_lcm(int,int,int) : to find lcm using a,b,hcf void result( ) : to invoke rehcf( )and fn_lcm() and to to print lcm, hcf of two numbers a,b Specify the class Hifact giving the details of constructor ,void getdata (),void change(), int rehcf() and int fn_lcm().Write the main function and find the hcf and lcm of any two integers ,a and b. Slide 6: Sum= 1+x/1! + x3/2! + x5/3! + ………+ x2n-1/n! A class sum series has been defined to calculate sum of the above series. Some of the members of the class are given below. Class name : sumseries Data members/member variables x,n :(integer) Sum : double Member functions/methods sumseries() : constructor int factorial(int n) : calculates and returns factorial of n double term(int p, int q) :Calculates and returns the value of p/q! by making use of factorial(int) Slide 7: void accept() : inputs the value of member data x,n void displaysum() : Displays the value of member data sum double calsum( ) : Calculates the sum of the given series using the appropriate data and other member function Specify the class sumseries giving details of the constructor and all the method.You do not need to write the main function . Slide 8: A class recursion has been defined to find the Fibonacci series upto a limit. Some of the members of the class are given below. Class name : recursion Data members/member variables a,b,c,limit : all integers Member functions/methods recursion( ) : constructor to assign a,b,c with the appropriate values. Slide 9: void input( ) : to accept the limit of the series int fib(int n) : to return the nth Fibonacci term using recursive technique void generate_fibseries ( ) : to generate Fibonacci series upto the given limit. Specify the class recursion giving the details of the constructor and other functions. Slide 10: A class called number has been defined to find the frequency of each digit present in it and the sum of the digits and to display the results . Some of the members of the class are given below. Class name :number Data members/member variables num : long integer type Member functions/methods number() : constructor to assign 0 to num number(long n) : constructor to assign n to num Slide 11: void digit_frequency() : to find the frequency of each digit and to display it. Int sum_digit( ) : to return the sum of the digits of the numbers Specify the class number giving the details of the two constructors and functions void digit_frequency( ) and int sum_digit( ).You do not need to write the main function.