Skip to main content

Online lecture assignments for XI Sc

Hello Programmers,
To use this medium effectively, refresh this page every 10 min or so for as long as the lecture is in session, since I will update this post time and again. You can also try coming in on NetMeeting (if that works) by reading the instructions on our web.

Here you go:
  1. Given three numbers a, b & c you can find out which is the largest of them by comparing each number with the others in turn. Can you do this in a program? The logic goes like this:
  1. 1. Take a, b, c from the user
  2. 2. Is a > b and c ... then a is largest
  3. 3. Is b > a and c ... then b is largest
  4. 4. If none of the above, then c is largest
Now what will you do if you need to find the largest among say a 100 numbers??? Can the same logic work?
Using arrays makes life better while computing large data. So try this logic
  1. Take the numbers as inputs into an array having an appropriate size, say 'n'
  2. define an arbitrary high value - max - maybe 0
  3. Run loop from 0 to n
  4. In each iteration, check if the i'th element of the array is larger than max
  5. If the ith element is bigger than max, change the value of max to the ith element
  6. at the end of the loop you get your value in max
Will give you more assignments with arrays and using the File commands by the evening. Try them over the weekend.

Comments

All Time Popular Posts

Annual Day 2023

 After a long hiatus due to covid we finally got most activities on track. The Annual Day function is always a big deal for everyone at Abhinav. It has been a tradition my mother started that the Annual Day will be not a Teacher-managed event, but a Student Initiative. Since when I was a teenager, I was part of this and today 10 years after she passed, I still strive to make it work as she would have. After some hesitation, we began working in early January. I wanted to use an outside choreographer just so that teachers will not be burdened. (They are already struggling with post-covid learning difficulties) But then, an outside guy could never do justice to the Abhinav style of doing things. We always keep in mind that the cultural program should be enjoyable to everyone in the audience and at the same time should display as many of the diverse talents that our students have, as possible.  It was a great relief that my G3 students came to the rescue. Almost all of std 9 and m...

Trapping events - IT assignment for Std XI

Perform these tasks on your PC and give yor answers as comments to this post or as an email to my ID - director@abhinav.ac.in . What is the sequence for the events given below and when do they occur for the given object? a) Textbox - Change, KeyPress, KeyDown, Validate b) Command button - Click, GotFocus, LostFocus, KeyPress c) Combo Box - Change, Click, DblClick, DropDown, Scroll Draw an equilateral triangle (should actually look like it) whose one vertex is the point at which the user clicks on the form. Make a simple calculator which has buttons for different numbers & operations (+, -, *, /, ^) and a box to display the result of each operation as well as each number being typed.

Expression Calculator in Java

Std X CA students: Here is another assignment to be finished before Thursday 24th Apr, 2014, 8 am. Reverse engineer the application I have posted at the FB group - Expression Caculator . i.e. 1. download the file and save in the root of c-drive 2. run it in command prompt using "java -jar c:\exprcalc.jar" 3. enter various expressions to compute like 2 + 3 = (then enter) 4. once you type '=' and a white space and enter, it displays the result. 5. You can take a long expression like 7.5562 / 7.889 + 5 - 12.67 = (then enter) 6. You can type another expression after the result for the previous is shown. 7. It also handles errors well. Figure out the code and paste your answers here as a comment. Hint: It uses a blank for loop ... i.e. for (;;) { here goes the code }to repeat taking many numbers one after the other.