Friday, November 21, 2014

Dynamic Web Site --- Prototype

College web team has planned to develop a dynamic college web site using STRUTS framework. They submitted this project proposal to the Principal. Principal asked them to develop a prototype of the Home Page and asked them to give a demo tomorrow.
College web team requests your help to develop the prototype. Can you please help them out?

Sample Input and Output: 
[All text in bold corresponds to input and the rest corresponds to output]
Enter college name
AIT
Enter college locality
Kurumbapalayam
Enter college's vision
EnrichingStudentMinds
Enter college's mission
ActivityBasedLearning
Enter the number of departments
5
Enter student strength
1000
Enter college rating
A
AIT
Kurumbapalayam
______________________________
Vision
EnrichingStudentMinds
______________________________
Mission
ActivityBasedLearning
______________________________
Number of departments
5
______________________________
Student Strength
1000
______________________________
College Rating
A
______________________________


#include<stdio.h>
int main ()
{
  char collegename[100],collegelocality[100],vision[100],mission[100];
  int noofdepartments, studentsstrength;
  char rating;
  printf("Enter college name\n");
  scanf("%s", collegename);
  printf("Enter college locality\n");
  scanf("%s", collegelocality);
  printf("Enter college's vision\n");
  scanf("%s", vision);
  printf("Enter college's mission\n");
  scanf("%s", mission);
  printf("Enter the number of departments\n");
  scanf("%d", &noofdepartments);
  printf("Enter student strength\n");
  scanf("%d", &studentsstrength);
  printf("Enter college rating\n");
  scanf("\n%c",&rating);
  printf("%s\n", collegename);
  printf("%s\n", collegelocality);
  printf("______________________________\n");
  printf("Vision\n%s\n", vision);
  printf("______________________________\n");
  printf("Mission\n%s\n", mission);
  printf("______________________________\n");
  printf("Number of departments\n%d\n", noofdepartments);
  printf("______________________________\n");
  printf("Student Strength\n%d\n", studentsstrength);
  printf("______________________________\n");
  printf("College Rating\n%c\n", rating);
  printf("______________________________\n");
  return 0;
}

NEWSPAPER REPORT

In Japan ,there was a very huge Tsunami. Millions and millions worth buildings and properties were destroyed. Many people lost their lives. Most of them were injured and few were safe. A news reporter arrives to the spot to take the current survey regarding the situation of the people alive , dead and injured. He wanted to publish it in the newspaper and ask the other countries to help the affected people.  
Can you please help him in this noble cause by writing a C program to generate the newspaper report?

SAMPLE INPUT AND OUTPUT FORMAT:
Enter the number of people dead:
2000
Enter the number of people injured:
3000
Enter the number of people safe:
10000
TSUNAMI REPORT OF JAPAN
The number of people
1)Dead:2000
2)Injured:3000
3)Safe:10000
Please help the people who are suffering!!!

include<stdio.h>
int main ()
{
  int dead;
  int injured;
  int safe;
  printf("Enter the number of people dead:\n");
  scanf("%d", &dead);
  printf("Enter the number of people injured:\n");
  scanf("%d", &injured);
  printf("Enter the number of people safe:\n");
  scanf("%d", &safe);
  printf("TSUNAMI REPORT OF JAPAN\n");
  printf("The number of people\n");
  printf("1)Dead:%d\n", dead);
  printf("2)Injured:%d\n", injured);
  printf("3)Safe:%d\n", safe);
  printf("Please help the people who are suffering!!!");
  return 0;
}

GROSSORY SHOP

A new grossory shop has to be opened. The owner asks the accontant to take a print of price list of the items to be sold in the store. The bill should have the details of the item and its cost. The items that the owner decides to sell initially are A4sheets, pen, pencil and eraser. The accountant is an experienced person and he very well knows that more number of items will be added to the list as the business picks. The accontant is well versed in programming and he decides to write a C program to generate the price list. 

Sample Input and output :
Enter the cost of A4sheet:
40
Enter the cost of Pen:
20
Enter the cost of Pencil:
10
Enter the cost of Eraser:
5
Items Details
A4sheet:40
Pen:20
Pencil:10
Eraser:5

#include<stdio.h>
int main ()
{
  int a4;
  int pen;
  int pencil;
  int eraser;
  printf("Enter the cost of A4sheet:\n");
  scanf("%d", &a4);
  printf("Enter the cost of Pen:\n");
  scanf("%d", &pen);
  printf("Enter the cost of Pencil:\n");
  scanf("%d", &pencil);
  printf("Enter the cost of Eraser:\n");
  scanf("%d", &eraser);
  printf("Items Details\n");
  printf("A4sheet:%d\n", a4);
  printf("Pen:%d\n", pen);
  printf("Pencil:%d\n", pencil);
  printf("Eraser:%d\n", eraser);
  return 0;
}

ROBOT

Think that you are a scientist and you have invented a Humanoid Robo.You want to introduce your Robo in a public meeting.You need to feed the information that the Robo has to speak in the public meeting.So feed the basic information into the Robo using C program.

Sample Input and output:
Enter the Name :
Chitti
Enter the Creator Name :
Dr.Vasegran
Enter the Purpose :
militaryservice
Memory Space :
22
Speed :
1.1
My Details :
I am the Robot named Chitti.
I was created by Dr.Vasegran.
I am created for the purpose of militaryservice.
My memory space is around 22Gb and my speed is 1.1Tb.

#include<stdio.h>
int main ()
{
  char a[20], b[20], c[20];
  int d;
  float e;
  printf("Enter the Name :\n");
  scanf("%s", a);
  printf("Enter the Creator Name :\n");
  scanf("%s", b);
  printf("Enter the Purpose :\n");
  scanf("%s", c);
  printf("Memory Space :\n");
  scanf("%d", &d);
  printf("Speed :\n");
  scanf("%f", &e);
  printf("My Details :\n");
  printf("I am the Robot named %s.\n",a);
  printf("I was created by %s.\n", b);
  printf("I am created for the purpose of %s.\n", c);
  printf("My memory space is around %dGb and my speed is %.1fTb.\n", d,e);
    return 0;
}

WELCOME ALIENS

Write a C program to welcome the alien to our planet EARTH. 

#include<stdio.h>
int main ()
{
  char a[10];
  printf("Enter your name:\n");
  scanf("%s", a);
  printf("Hello %s ! Welcome to our planet Earth.", a);
  return 0;
}