import java.io.*;
class Shop
{
String code[]=new String[20];
String name[]=new String[20];
float price[]=new float[20];
int i,j;
Shop()
{
i=0;
}
void getitem() throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter ItemCode:");
code[i]=br.readLine();
System.out.println("Enter ItemName:");
code[i]=br.readLine();
System.out.println("Enter UnitPrice:");
price[i]=Float.valueOf(br.readLine()).floatValue();
i++;
}
void printitem()
{
System.out.println("\n ItemCode\tItemName\tunitPrice\n");
for(j=0;j<i;j++)
{
System.out.println(code[j]+"\t\t");
System.out.println(name[j]+"\t\t");
System.out.println(price[j]+"\t\t");
}
}
}
class ShopOnl
{
public static void main(String args[]) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int ch=0;
Shop s=new Shop();
while(ch!=3)
{
System.out.println("1.Get Item");
System.out.println("2.View Bill");
System.out.println("3.Quit");
System.out.println("Enter your choice");
ch=Integer.parseInt(br.readLine());
switch(ch)
{
case 1:
s.getitem();
break;
case 2:
s.printitem();
break;
case 3:
System.out.println("Thank you! visit again");
break;
}
}
}
}
import java.io.*;
class ShopReceipt
{
protected static void main()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the no. of types of Items Purchased: ");
byte z=Byte.parseByte(in.readLine());
String n[]=new String[z];
byte q[]=new byte[z];
float r[]=new float[z];
float pr[]=new float[z];
System.out.println("PLEASE ENTER::");
for(byte i=0;i<z;i++)
{
pr[i]=0;
System.out.print("Name of Item: ");
n[i]=in.readLine();
System.out.print("Rate of Item: ");
r[i]=Float.parseFloat(in.readLine());
System.out.print("Quantity of Items: ");
q[i]=Byte.parseByte(in.readLine());
pr[i]=r[i]*q[i];
}
double t=0;
for(byte i=0;i<z;i++)
t+=pr[i];
for(byte i=0;i<z;i++)
System.out.print("Item: "+n[i]+"\tQuantity: "+q[i]+"\tTotal Cost: "+pr[i]+"\n");
System.out.print("\nBill:"+t);
if(t>=100&&t<500)
System.out.print("\nGift::\nA Key Ring");
else if(t>=500&&t<1000)
System.out.print("\nGift::\nA Leather Purse");
else if(t>=1000)
System.out.print("\nGift::\nA Pocket Calculator");
}}
/* For first 100 calls: Rs 100/-
* For Additional 50 calls: Rs 2/- per call
* For Calls more than 150: Rs 2.5/- per call
*/
import java.io.*;
class TelephoneBill
{
protected static void main()throws IOException
{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the no. of calls: ");
int a=Integer.parseInt(in.readLine()),i=0;
float c=0;
while(0<1)
{
if(a<=100)
{
c=100;
break;
}
else if(150>=a&&a>100)
{
if(i==a)
break;
i++;
c+=2;
}
else
{
if(i==a)
break;
i++;
c+=2.5;
}
}
System.out.print("Amount to be paid: "+c);
}}
Private void ............................................................ {
int=Integer.parseInt(noofdaytf.getText);
int bill;
{
bill=noofday*150;
}
bill.setText("your cable bill is"+bill)
}
Shpooing bill, notepad, floor, piece of paper. You name it. You just need a pen and a bill
echo 'print a pattern'
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
write a program to print the series 1/12+1/22+.........+1/n2 ?
This is a directive, not a question.
#include
write a program to print A to Z on screen in c?
echo 'print a pattern'
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
write a program to print the series 1/12+1/22+.........+1/n2 ?
#include<stdio.h> main() { int a; print f("enter your amount "); scan f("%d",&a); }
I am very tempted to write a program to display something rude about your teacher to get you in trouble. I have chosen not too but will give you a hint that will require you to do a small amount of reading and a small amount of thinking. Hello world Programming require reading and thinking, get used to it.
#this program to calculate princple amount using perl. print "enter the amount given;","\n"; $A=<stdin>; print "enter the rate of interst given;","\n"; $R=<stdin>; print "enter the no of years given;","\n"; $Y=<stdin>; $o=1+$R; $e=$o**$Y; $t=1/$e; $f=1-$t; $p= $A*$f; print "princple amount $p";
good morning
Yes.
This is a directive, not a question.
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
include <stdio.h> int main (void) { puts ("print"); return 0; }