Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.
All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!
pa help naman po
Write a function oriented program that calculates the power value of the input base number & exponent number. Then display the power value.
Sample input/output dialogue :
Enter base number : 5 (input data)
Enter exponent number : 3 (second input data)
Power value : 125 (Output)
(The computation is 5^3=5*5*5=125)
thanks in advance
result = base ^ exponent;
result = pow(base, exponent);
result = base;
for (i = 1; i < exponent; i++)
{
result = result * base;}
import java.util.*;
class cv
{
public static void main(String[] args)
{
Scanner p = new Scanner(System.in);
System.out.println("0 1 2 3 4 5 6 7 8 9");
System.out.println("U S T - Z W K A H ? ");
System.out.println("Enter Coded Value: ");
String letter = p.next();
if(letter.equals("U"))
System.out.print("0");
if(letter.equals("S"))
System.out.print("1");
if(letter.equals("T"))
System.out.print("2");
if(letter.equals("-"))
System.out.print("3");
if(letter.equals("Z"))
System.out.print("4");
else if(letter.equals("W"))
System.out.print("5");
else if(letter.equals("K"))
System.out.print("6");
else if(letter.equals("A"))
System.out.print("7");
else if(letter.equals("H"))
System.out.print("8");
else if(letter.equals("?"))
System.out.print("9");
else
System.out.println("Wrong Value");
}
}
}
#include <stdio.h>
#include <conio.h>
void main (){
clrscr();
getch();
int n=100,i=1,j,c;
char answer;
clrscr();
printf ("Enter number of terms ranging form 1 - 100 : ");
scanf ("%d",&n);
if (n<1 || n>100)
printf ("You enter a wrong number!");
else
while(i<=n)
{
c=0;
for(j=1;j<=1;j++)
{
if(i%j==0)
c++;
}
if(c==2)
printf("%d /n",i);
i++;
}
getch();
}
need help po!
kaylangan q pong gumawa ng Program na humihingi ng number input sa user range from 1- 100
at
tinutukoy kung anu ang mga PRIME NUMBERS sa inimput nyang number....
eto po ang sample ng program q...
dapat po ma print lahat ng PRIME NUMBERS within the input number by the user...
please,,.. need q po tlga,..
kung ok lang po sa inyo, paki send nalang po via MESSAGE ang reply nyo...
TURBO C pala ang gamit ko....
Thanks in advance..
//You can do also while in this... I used for para madali.
for (i = 1; i <= number; i++)
{
//Always reset count after a number...
count = 0;
//Dito palitan mo ng i ang 1...
for (j = 1; j <= i; j++)
{
//Reverse mo yong i at j mo.
if (j % i == 0)
{
count++;
}
}
if (count == 2)
{
//display prime number.
}
}
Write a program using String that accepts a coded value of an item & display its equivalent tag price.
0 1 2 3 4 5 6 7 8 9
U S T - Z W K A H ?
Input: -WZ.UA
Output: 354.07
I have come up with this but it only output 1 letter..
Code:import java.util.*; class cv { public static void main(String[] args) { Scanner p = new Scanner(System.in); System.out.println("0 1 2 3 4 5 6 7 8 9"); System.out.println("U S T - Z W K A H ? "); System.out.println("Enter Coded Value: "); String letter = p.next(); if(letter.equals("U")) System.out.print("0"); if(letter.equals("S")) System.out.print("1"); if(letter.equals("T")) System.out.print("2"); if(letter.equals("-")) System.out.print("3"); if(letter.equals("Z")) System.out.print("4"); else if(letter.equals("W")) System.out.print("5"); else if(letter.equals("K")) System.out.print("6"); else if(letter.equals("A")) System.out.print("7"); else if(letter.equals("H")) System.out.print("8"); else if(letter.equals("?")) System.out.print("9"); else System.out.println("Wrong Value"); } } }
I know there's missing, i dont know how to do this further.. can anyone help me?
Write a program using String that accepts a coded value of an item & display its equivalent tag price.
0 1 2 3 4 5 6 7 8 9
U S T - Z W K A H ?
Input: -WZ.UA
Output: 354.07
I have come up with this but it only output 1 letter..
Code:import java.util.*; class cv { public static void main(String[] args) { Scanner p = new Scanner(System.in); System.out.println("0 1 2 3 4 5 6 7 8 9"); System.out.println("U S T - Z W K A H ? "); System.out.println("Enter Coded Value: "); String letter = p.next(); if(letter.equals("U")) System.out.print("0"); if(letter.equals("S")) System.out.print("1"); if(letter.equals("T")) System.out.print("2"); if(letter.equals("-")) System.out.print("3"); if(letter.equals("Z")) System.out.print("4"); else if(letter.equals("W")) System.out.print("5"); else if(letter.equals("K")) System.out.print("6"); else if(letter.equals("A")) System.out.print("7"); else if(letter.equals("H")) System.out.print("8"); else if(letter.equals("?")) System.out.print("9"); else System.out.println("Wrong Value"); } } }
I know there's missing, i dont know how to do this further.. can anyone help me?