The document is an exam for an Introduction to Internet Programming course, consisting of two compulsory questions worth 10 marks each. The first question asks students to write a Java program to calculate the sum of a harmonic series given an interactive user input for n. The second question asks students to write a Java program to extract a portion of a character string starting from the nth character for a length of m, accepting both n and m through interactive user input.
Program to determine the sum of a harmonic series and extract a portion of a character string
1. No. of Printed Page :1 SET-3
BACHELOR IN COMPUTER APPLICATIONS (BCA)
Term-End Practical Examination 00296
June, 2011
CS-74P : INTRODUCTION TO INTERNET PROGRAMMING
Time allowed : 1 hour Maximum Marks : 30
(VVeightage : 15%)
Note : There are two compulsory questions, 10 marks each. 10 marks for viva—voce. All
programs are to be written in Java.
1. Write a program to determine the sum of the following harmonic series for a given 10
value
1
1+ Y + Y +
2 3 + —
n
The value of n should be given interactively-through the keyboard.
2. Write a program to extract a portion of a character string, and print the extract string. 10
Assume that m characters are extracted, starting with the nth character. The value of m and
n should be accepted through the keyboard.
CS-74P/S3 1 3,000