Showing posts with label TCS. Show all posts
Showing posts with label TCS. Show all posts

Saturday, 26 November 2011

Last day @ TCS-ILP


This post is addressed particularly to my ILP associates. To others, this is what happened in our final day of my first corporate, details might be insignificant for you.


CHN-09 M70
         A red letter day it was, 25th Nov, 2011. I can't stop myself thanking my friends before even beginning my post. Day was a mixture of boring, surprising, serious, fun filled and finally emotional departure. Many guys  felt the joy of leaving the ILP before a week itself, and when the most anticipated final day arrived none of them wanted to leave the ambience made by associates. Truly , I personally feel it was like a ninth semester of my college. Many of the CHN-09 came with ethnic wear, which made us different from others. 


       That was the only day we enjoyed much with the permission of the faculty . We kidded one another in Zone till 11 a.m as like everyday, without knowing we ll never sit like this in this zone. Then the Last session has begun, Owing to lack of capacity in room most were made to stand. But I didn't feel the pain as the momentum was like that. 


      It was fun beyond the words, Most of the activities are simply superb esp M73, Saurav's spot comedy, M70 skit and 3-idiots song sung by one. 


Emotional Departure :


     90 days went faster than what we thought, and I wish those last week should be for ever. Then finally everybody went to receive their relieving order and surprisingly I got the feedback paper wrote by my associates , Wow really it could't have been better feedback, I never knew this I'd get . Most unexpectedly there we wrote the feelings  at the back of the everyone's group photos. 


To my dear Associates Personally :


    People will come and go like as winter wheat, but their names remains in the annals. You are not just a passing clouds in my life,  You are all part of my life, you guys have written the story of my life in these 3 months. When I think about my first salary, first corporate life, first company everybody will come into my mind. By your feedbacks I am really surprised and thanks for the everything . I have learnt many things apart from studies .I'm sure many people ll have the dents made by me , I'm sorry for that I never wanted to hurt anyone. CHN-09 M70 words to be carved in everyone's mind . 


we knew we would keep in touch, but we also knew we would never be together. I thought It would a pre-training but never thought it would be a post college. 


                                                 `Miss you guys`

Monday, 8 August 2011

java Assignments1.

hello folks, Here s d ansz for all the ten problems in java assignments1. As for as i concerned it z correct upto my knowledge. Reg compiling n running also it works good. I say u  not to upload the same things directly. If u aware of java just edit as  u wish and if u don't know anything abt java, jz  change the class names(which s at 2nd o 3rd line of each prog : class jx(change this jx to other word) , words within inverted commas in output lines and variables.


Solutions:




Program1: Write a program to find the difference between sum of the squares and the square of the sums of n numbers?

import java.io.*;
import java.util.Scanner;
class j1
{
public static void main(String args[]) throws IOException
{
Scanner s=new Scanner(System.in);
System.out.println("How many numbers:");
int n=s.nextInt();
int a[]=new int[n];
int i, sqr, diff, count=0, plus=0;
System.out.print("Type the  "+n + " Numbers \n");
for(i=0;i<n;i++)
{
a[i]=s.nextInt();
count+=(a[i]*a[i]);
plus+=a[i];
}
sqr=plus*plus;
diff=sqr-count;
System.out.print("\nSum of Squares of given "+n +"number is :"+count);
System.out.print("\nSquares of Sum of given "+n + "number is :"+sqr);
System.out.println("\nDifference between sum of the squares and \nthe square of the sum of given "+n + " number is :"+diff);
}}

Program 2: Develop a program that accepts the area of a square and will calculate its perimeter.

import java.util.*;
import java.text.*;
class  j2
{
public static void main(String[] args){
         DecimalFormat df = new DecimalFormat("##.00");
         Scanner input=new Scanner(System.in);
         System.out.println("Enter Area of Square:");
         double area=input.nextDouble();
         System.out.println("Perimeter of Square is :"+df.format(4*Math.sqrt(area)));
         }}

Program 3: Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk and its height and computes the volume of the cylinder.

import java.util.*;
class j3
{
   public static void main(String[] args)    {  
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Radius: ");
        double r=input.nextDouble();
        System.out.print("Enter Height: ");
        double h=input.nextDouble();
        System.out.println("Volume of Cylinder: "+(Math.PI*r*r*h));
    }}

Program 4:  Utopias tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program calculateTax which determines the tax on the gross pay. Define calculateNetPay that determines the net pay of an employee from the number of hours worked. Assume an hourly rate of $12.

import java.util.*;
import java.text.*;
public class j4
{
    public static void main(String[]args){
    DecimalFormat df=new DecimalFormat("$##.00");
    Scanner input=new Scanner(System.in);
    System.out.print("Enter Number of Hours Worked: ");
    double hours=input.nextDouble();
    double pay=(hours*12)-(hours*12*0.15);
    System.out.println("Net Pay is: "+df.format(pay));
    }}

Program 5: An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes the number of attendees (of a show) and calculates how much income the show earns.

import java.io.*;
class j5
{
public static void main(String[] s) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the number of customers");
int ticket=Integer.parseInt(br.readLine());
System.out.println("Total Income: "+((5*ticket)-(20+(0.5*ticket))));
}}

Program 6: Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder.
Hint :surface area of a cylinder is 2pi*r2 + 2pi*R2


import java.util.*;
import java.text.*;
class j6
{
    public static void main(String[] args)
    {
        DecimalFormat df = new DecimalFormat("##.00");
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Radius: ");
        double r=input.nextDouble();
        System.out.print("Enter Height: ");
        double h=input.nextDouble();
        double surfarea=2*Math.PI*r*(r+h);
        System.out.println("Surface Area of Cylinder: "+df.format(surfarea));
       }
}

Program 7: Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three values: the pipes inner radius, its length, and the thickness of its wall.

Hint: here surface means inner, outer , top n bottom 2pi*r*h + 2pi*R*h + 2(pi*R2-pi*r2)


import java.io.*;
class j7
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter inner radius");
double r=Integer.parseInt(br.readLine());
System.out.println("Enter thickness");
double t=Integer.parseInt(br.readLine());
System.out.println("Enter height");
double h=Integer.parseInt(br.readLine());
double R=r+t;
double surfacearea=((2*Math.PI*r*h)+(2*Math.PI*R*h)+((2*Math.PI)*((R*R)-(r*r))));
System.out.println("Total Suraface Area: "+(surfacearea));
}}


Program 8: Develop the program calculateHeight, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g · t in t time units and a height of 1/2 * v * t where v is the speed at t.
Hint : Simple Physics laws of motion aptitude question


import java.util.*;
import java.text.*;
class j8
{
public static void main(String[] args)
{
DecimalFormat df = new DecimalFormat("##.00");
Scanner input=new Scanner(System.in);
 System.out.println("Enter the constant rate of Rocket:");
double g=input.nextDouble();
 System.out.println("Enter the time:");
double t=input.nextDouble();
double speed=g*t;
double height=0.5*speed*t;
System.out.println("Height that the rocket reaches in given time "+t + " is: "+df.format(height));
}}

Program 9: Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean Theorem is c2 = a2 + b2.
Hint :Simple question in confounding way-pythagorous theorem 

import java.io.*;
class j9
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the speed of the Boat:");
double bs=Double.parseDouble(br.readLine());
System.out.println("Enter the speed of the River:");
double rs=Double.parseDouble(br.readLine());
 System.out.println("Enter the width of the River :");
double width=Double.parseDouble(br.readLine());
double factor=rs/bs;
factor=(1/(1+factor*factor));
factor=Math.sqrt(factor);
System.out.println("Distance: "+(width/factor));
}}

Program 10: Develop a program that accepts an initial amount of money (called the principal), a simple annual interest rate, and a number of months will compute the balance at the end of that time. Assume that no additional deposits or withdrawals are made and that a month is 1/12 of a year. Total interest is the product of the principal, the annual interest rate expressed as a decimal, and the number of years.
Hint : Simple interest=(P*N*R)/100

import java.io.*;
class j10
{
public static void main(String[] xxx) throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the Principal amount:");
double pr=Integer.parseInt(input.readLine());
System.out.println("Enter the interest Rate (in %):");
double rate=Double.parseDouble(input.readLine());
System.out.println("Enter the total number of months:");
Double months=Double.parseDouble(input.readLine());
months=months/12;
double interest=0.01*(pr*rate*months);
System.out.println("Interest after "+months + " years are: "+interest);
System.out.println("Total Balance including principal at the end is :"+(pr+interest));
}
}