Pergunta de entrevista da empresa Manhattan Associates

Programming Round: 1) Write a program count 1 to 50 number. Every multiple of 3 it should print " Manhattan " and Every 5 multiple it should print " Associate " and combination of 3 and 5 multiple. it should print "Manhattan Associate". 2) How to create class for Smartphone feature using oops concept. Databse: They Given Three table : shellar name,Customer,order: 1) find out all shellarename who ever purches Maruti car. 2) find out all shellername who ever purches Honda and indika car.

Respostas da entrevista

Sigiloso

6 de dez. de 2017

public static void main(String [] args) throws Exception { System.out.println("enter the input number: "); Scanner s = new Scanner(System.in); int n = s.nextInt(); for(int i=1;i<=n;i++){ if((i%3==0)&&(i%5==0)) System.out.println(i+" Manhattan Associates"); else if(i%3==0) System.out.println(i+" Manhattan"); else if(i%5==0) System.out.println(i+" Associate"); else System.out.println(i+" conditions not met"); } }

1

Sigiloso

13 de fev. de 2016

class R { public static void main(String args[]) { int i=0; for(i=0;i<=50;i++) { if(i % 3==0) { System.out.println("Manhattan"); } if(i% 5==0) { System.out.println("Associate"); } if ((i%3==0) && (i%5==0)) { System.out.println("Manhattan Associate"); } else System.out.println(i); } } }

3