0% found this document useful (0 votes)
19 views4 pages

Project Computer X

this year coputer project

Uploaded by

Debarya Banerjee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views4 pages

Project Computer X

this year coputer project

Uploaded by

Debarya Banerjee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

VISION INTERNATIONAL SCHOOL

SESSION : 2023 - 24
SUBJECT : COMPUTER APPLICATIONS PROGRAMMING ASSIGNMENT
CLASS : X
Date of Date of
giving submission
Topic Programs
1. Kundu Travels Pvt. Ltd. gives the following discount to its customer as per given tariff:
Ticket Amount Discount
Above 70,000/- 18%
55,001 to 70,000/- 16%
Nested Loop 35,001 to 55,000/- 12%
25,001 to 35,000/- 10%
Less than 25,001/- 2%
Write a program to input the name and ticket amount for 10 customers and calculate the discount amount and
net amount to be paid. Display the output in the following format for each customer.
S. No Name Ticket Charge Discount Net Amount

2. A Special Number is said to be special number if the sum of the factorial of the digits of the number as same as the original
Nested Loop number. Write a program to accept a number and print whether the number is a Special Number or not. Input:145
Output: A Special Number

3. Write a menu driven program to accept a number from the user and check it is a BUZZ number or not or accept
any 2 numbers and print the GCD (Greatest common divisor).
(i) A BUZZ number is either ends with 7 or it is divisible by 7.
Switch Case (ii) GCD of 2 integer is calculated by continued division method. Divide the largest no. by smaller.
The remainder then divides the smaller. The process is continued till the reminder is 0. The last divider is called GCD of
two integers.

4. Write a menu driven program to accept a number and check and display whether it is a Prime Number or not or as
Automorphic Number or not.
Switch Case (i) A number is said to a prime number if it is divisible by 1 and by itself eg. 2,3
(ii) An Automorphic number is a number which is contained in the last digit(s) of its square.[25 is an Automorphic no]

Conditional 5. Write a program to accept a number and check and display whether it is a Niven number or not. Niven number is a
Statement number which is divisible by its sum of digits. e.g. 126 1 + 2 + 6 ® 9

Loop 6. Write a program to generate a tribonacci series 0,1,2,3,6,11 …………. till n terms.
Nested Loop 7. Write a program in java to find the sum of the following series :

Nested Loop 8. Write a program to find the sum of the following series :

1234554321 COMPUTER
1234 4321 O E
123 321 M T
12 21 P U
Nested Loop 9.. Write a menu driven program to print the patterns
1 1 U P
T M
E O
RETUPMOC

String 10. Write a program to input a string in uppercase and print the frequency for each character.

11. Write a program to accept a word and convert it into Pig Latin form. (Convert the word into uppercase and place the first
String vowel of the original word at the start of the new word along with the letters following it. The letters present
before the first vowel are shifted to the end of the new word followed by ‘ay’.)

12. Write a program to accept the string and convert it into uppercase and count an output of double letter sequences that exists in
String the string and display it.
13. Write a program to assign full path of a file into a string .Extract and display the following as given below:
String Using function extract the file path, file name and file extension separately.
14. Write a program to store 5 words in a single dimensional array and frame a new word by taking out the 1st
Array characters of each word. Arrange the alphabets of new word in ascending order using Selection Sort and
display resultant word.
15. Write a program to store 10 words in a single dimension array and display those words which is palindrome using
Array Linear Search techniques.
Array 16. Write a program to input 10 integer elements in an array and sort them in descending order in Bubble Sort
17. Write a java program to perform Binary Search on a list of integers given below,to search for an element input by the [Link]
Array it is found display the element along with its position,otherwise display the message "Search element not found".
[5,7,9,11,15,20,30,45,89,97]

18.. Define a class called BookFair with the following description :


Instance variables / data members :
String Bname : stores the name of the book
double price : stores the price of the book
Member method :
(i) BookFair() : constructor to initialize data members
(ii) void input() : to input and store the name and price of the book
(iii) void calculate() : to calculate the price after discount. Discount at calculated based on the following
Function criteria :

Price Discount
Less than or equal to Rs.1000 2% of price
More than Rs. 1000 and less than or equal to Rs.3000 10% of price
More than Rs. 3000 15% of price

(iv) void display() : to display the name and price of the book after discount. Write
a main method to create an object of the class and call the above member methods.
19. Design a class to overload a function polygon() as follows :
(i) void polygon(int n,char ch) : with one integer and one character type argument to draw a filled
square of side n using the character stored in ch.
(ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of length
x and breadth y, using the symbol '@'.
(iii) void polygon() : with no argument that draws a filled triangle shown below :
Example :
(i) Input value of n = 2, ch = 'O'
Function Output : OO
Overloading OO
(ii) Input value of x = 2, y = 5
Output : @@@@@
@@@@@

(iii) Output : *
**
***
20. Write a program to input a number and check and print whether it is a 'Pronic' number or not. Use a function
int Pronic(int n) to accept a number. The function returns 1, if the number is 'Pronic', otherwise returns zero (0).
(Hint : Pronic number is the number which is the product of two consecutive integers)
Function Examples : 12 = 3 * 4
20 = 4 * 5
42 = 6 * 7
the sum of diagonal numbers present in the diagonal position.
row total and each column total.
2 D Array form.
it.
check MATRIX multiplication possible or not.

Common questions

Powered by AI

Nested loops can efficiently calculate the sum of series by iteratively and cumulatively processing multiple levels of iterative calculations, consolidating complex series into manageable subsets. Each loop represents a series component; the outer loop might control sequence progression, and inner loops compute individual components, supporting iterative summation as the algorithm progresses . Efficiently, nested loops allow breaking complex numeric relationships into repeatable sub-tasks, accommodating arbitrary sequence rules—favorable when executing complex algorthmic designs needing concurrent calculations for sum constituents . This approach aligns algorithm readability with computational requirements, maintaining lower algorithmic complexity by restricting unnecessary reiterations through structured progression.

Both the Tribonacci and Fibonacci sequences are integer sequences where each term is the sum of preceding terms. The primary difference is the number of preceding terms involved: Fibonacci sums the two preceding terms, whereas Tribonacci uses the three preceding terms . This means the Fibonacci sequence starts from terms 0 and 1, generating subsequent terms by summing the last two values, while Tribonacci starts from 0, 1, and 2, needing an additional initial value. Generating these sequences using loops involves initializing the first few terms and iteratively calculating subsequent terms by summing the required number of previous terms. For Tribonacci, this loop typically involves maintaining variables for the last three terms and updating them iteratively .

Algorithmically, identifying Prime numbers involves checking divisibility from 2 up to the square root of the number, having a time complexity of approximately O(√n). Automorphic number detection requires squaring a number and comparing its tail digits with the original, predominantly a direct comparison operation after squaring, making its complexity about O(d), where d is the digit length . While both operations primarily involve integer and basic arithmetic operations, associating different parts of real numbers to strings increases complexity for Automorphic checks. Thus, identifying Automorphic numbers might face higher constants often neglected in complexity theory but can impact practical computational efficiency, especially with large numbers .

Divide and Conquer ordinarily separates problems into independent subproblems for efficient recursiveness. Bubble Sort, however, follows a comparison-based, iterative bubble-up of the largest element, iteratively narrowing the unsorted elements without conventional Divide and Conquer autonomy, often resulting in slower O(n²) time complexity . Selection Sort locates extremum within unsorted sections for swapping, benefiting more tangibly under optimized conditions for data with known structural characteristics, albeit sharing Bubble Sort's elemental time complexity . Both routines are memory-efficient without leveraging recursive separation but differ in adaptability based on input sequence characteristics, influencing their preference in educational contexts rather than volume-intensive applications.

Polymorphism in the overloaded polygon methods is evident through the ability to define multiple forms of a single operation—drawing geometric shapes—based on different input parameters such as integers and characters. Different method signatures (int, char for drawing squares; two ints for rectangles) exemplify static polymorphism or compile-time polymorphism . The benefits include a flexible and intuitive API for drawing various shapes, minimizing the need for method naming complexity and allowing compile-time type safety, enhancing program clarity and maintenance by encapsulating shape logic within concise, interchangeable method forms .

The Pig Latin conversion program focuses on linguistic transformation by repositioning based on vowel presence, applying specific rules for vowel location to create new word forms, emphasizing language processing techniques . In contrast, the program analyzing uppercase conversions and character frequency operates on statistical analysis, categorizing and counting string character instances, important for information extraction from textual data rather than alteration. These programs address distinctly different aspects of string processing: one transforms language structure, while the other quantifies string properties . Conceptually, Pig Latin involves syntactic rearrangement, whereas frequency analysis involves counting, intersecting computational linguistics and data analysis disciplines .

The discount structure of Kundu Travels Pvt. Ltd. offers varying discounts based on ticket amounts, with increasing discounts for higher spending: 2% below 25,001, scaling to 18% for amounts above 70,000 . This structure can incentivize customers who are close to a higher threshold to spend slightly more to obtain a more significant discount, effectively increasing overall spending. For instance, a customer considering a 54,000 purchase might be encouraged to upgrade to just above 55,001 to benefit from a 16% rather than a 12% discount. This upselling strategy leverages tiered discounts to maximize sales volume around the threshold amounts .

Detecting Automorphic numbers involves checking whether a number appears in the last digits of its square. The main challenges include handling numbers with potentially long digits, especially interpreting the tail of squared numbers efficiently . Nested loops can aid this process by iterating through possible digits for modification and comparison, emphasizing verification of the trailing string of the number’s square against the original number. Challenges also lie in memory handling for large numbers and preserving computational efficiency, requiring careful consideration of loop bounds and conditions to ensure correctness without redundant calculations .

A Special Number is one where the sum of the factorial of its digits equals the original number . A Niven Number, on the other hand, is divisible by the sum of its digits . For a number to be both a Special and a Niven number, it must simultaneously satisfy both these conditions. A potential example could be 145; however, upon checking, 145 is only a Special Number, since 1! + 4! + 5! = 145, but it is not divisible by the sum of its digits (1 + 4 + 5 = 10). Thus, it’s rare to find numbers that meet both classifications, which would require an intricate balance between the factorial sums and the divisibility by the sum of digits.

The traditional Euclidean algorithm utilizes repeated division and the remainder operation to find the GCD, often implemented recursively, which is efficient for most inputs. The continued division method is a procedural variant where iterative division is emphasized, specifically dividing the larger by the smaller and iterating until a zero remainder is reached, allowing capturing the last non-zero divisor as the GCD . Though functionally similar, the difference lies in implementation style: the continued division is iterative, potentially more accessible to those learning iterative methods, whereas Euclidean's recursive variant suits scenarios favoring clarity and efficiency inherent in recursive designs. Preferences in programming assignments might lean towards loop-based, continuation division techniques when teaching basic iteration and arithmetic concepts in early programming education .

You might also like