Kytcs.Blogspot.com: infypaperpattren
Showing posts with label infypaperpattren. Show all posts
Showing posts with label infypaperpattren. Show all posts

Java Movie Management

Welcome to the my blog



Java Movie Management








import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
   public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        Movie[] mv = new Movie[4];
        for(int i=0;i<4;i++)
        {
            int a = sc.nextInt();sc.nextLine();
            String b = sc.nextLine();
            int c = sc.nextInt();
            int d = sc.nextInt();
            mv[i] = new Movie(a,b,c,d);
        }
        sc.nextLine();
        String nm = sc.nextLine();
        int um = sc.nextInt();
        int dm = sc.nextInt();
        int res = findAvgBudgetByDirector(mv, nm);
        if (res>0)
        System.out.println(res);
        else
        System.out.println("Sorry - The given director has not yet directed any movie");
        Movie temp = getMovieByRatingBudget(mv, um, dm);
        if(temp == null)
        System.out.println("Sorry - No movie is available with the specified rating and budget requirement");
        else
        System.out.println(temp.id);

    }

    public static int findAvgBudgetByDirector (Movie[] mv, String nm)
      {
          //method logic
          int avg,s=0,j=0;
          for(int i=0;i<4;i++)
          {              
              if(nm.equalsIgnoreCase(mv[i].dt))
              {
                  s = s+mv[i].bt;
                  j++;
              }
          }
              if(j>0)
              {
                  avg = s/j;
                  return avg;
              }          
              else 
              return 0;
      }

    public static Movie getMovieByRatingBudget(Movie[] mv, int rating, int budget)
      {
          //method logic
          Movie temp = new Movie();
          for(int i=0;i<4;i++)
          {
              if((rating == mv[i].rt) && (budget == mv[i].bt) && (mv[i].bt % mv[i].rt == 0))
              {
                  temp.id = mv[i].id;
                  return temp;
              }
          }
          return null;   
          
      }
}

class Movie
{
    //code to build Movie class
    int id,rt,bt;
    String dt;
    Movie()
    {

    }
    Movie(int id, String dt, int rt, int bt)
    {
        this.id = id;
        this.dt = dt;
        this.rt = rt;
        this.bt = bt;
    }
}

Unix code

Welcome to the my blog
OPA -JAVA UNIX Student details


#!/bin/bash
read 
awk 'BEGIN{FS=",";t=0}
 {
a[t]=$1;
b[t]=$3+$4;
c[t]=$2;
 
t=t+1
 
}
END
{
for(i=0;i<t;++i)
{
   ma=0;
    pos=i;
    for(j=0;j<t;++j)
    {
        if (b[j]>ma)
        {
            ma=b[j];
            pos=j;
        }
    }
    if (b[pos]>99)
    print a[pos],c[pos];
    b[pos]=-1;
 
}
}
'

Infosys Placement Papers Syllabus

Infosys Placement Papers Syllabus 2019

Infosys previous year papers give a gist of the syllabus from which most of the questions in the drive would be asked. The syllabus gives a good idea of what topics should be prepared.

Infosys Quantitative Aptitude Questions


The syllabus for Infosys quantitative aptitude section is as follows:
  • Percentages
  • Profit and Loss
  • Permutation and Combination
  • Probability
  • Speed Time and Distance
  • Boats and Streams
  • Time and Work
  • Data Interpretation
  • Mixtures and Allegation

Followers

Ad Space