Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C# program to check whether a string is palindrome or not . Test Data : Enter String : Malayalam Expected Output : String

  1. Write a C# program to check whether a string is palindrome or not .

Test Data :

Enter String : Malayalam

Expected Output :

String is Palindrome

Entered String Was malayalam and reverse string is malayalam

  1. Write a program in C# Sharp program to create a function to calculate the sum of the elements in an array and check whether sum is an Armstrong number or not, using another function.

[15 marks]

Test Data :

Enter Array limit : 5

Input 5 elements in the array :

element - 0 : 1

element - 1 : 2

element - 2 : 3

element - 3 : 4

element - 4 : 5

The sum of the elements of the array is 15

Not Armstrong Number

  1. Write a C# application that implements a class 'number" with the following functionality.
  2. Three data members 'n', 'dsum' and 'rev' of integer data type.
  3. Four public methods, readValues(),digitsum(), reverse() and dispResult()

i.readValues () - to accept the value of 'n' from the keyboard.

ii.digitsum () - to calculate the Digit sum of n.

iii.reverse () - to calculate the reverse of the number 'n'.

iv.dispResult() - to display the Digit sum and Reverse of 'n'.

In the Main method, create an object "N1" of the 'number" class, and calculate the Digit sum and Reverse using the above methods.[15 Marks]

Sample I/O

Enter a number : 1234

DigitSum = 10

Reverse = 4321

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions