Go Back   CodingForums.com > Search Forums

Before you post, read our: Rules & Posting Guidelines

Showing results 1 to 25 of 27
Search took 0.12 seconds.
Search: Posts Made By: sabi
Forum: Java and JSP 10-16-2012, 08:03 AM
Replies: 1
Views: 373
Posted By sabi
Reversing the elements of an array please help?

Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of...
Forum: Computer Programming 10-11-2012, 02:08 AM
Replies: 1
Views: 603
Posted By sabi
Need help with generating random numbers

I need to generate random numbers between 100 and 999
this is what i got but this doesn't work every time. It goes over 999 sometimes


#include <iostream>
#include <cstdlib>
#include <ctime>
...
Forum: Java and JSP 09-28-2012, 06:28 AM
Replies: 2
Views: 2,045
Posted By sabi
This is what I got but I dont think this is exactly what the problem is asking for

cin >> areaOfSquare;

if(areaOfSquare >= 0)
{
length = sqrt(areaOfSquare);
cout << length;
}
else
{
cout << "INVALID";
Forum: Java and JSP 09-28-2012, 06:24 AM
Replies: 2
Views: 2,045
Posted By sabi
How to make this work with if/else

NOTE: in mathematics, the square root of a negative number is not real; in C++ therefore, passing such a value to the square root function is an error.

Given a double variable named areaOfSquare...
Forum: Java and JSP 05-07-2012, 12:33 AM
Replies: 1
Views: 647
Posted By sabi
Need help with Two-Dimensional array

I added each row in a two-dimensional array and now I want to display this in decreasing order so How can I do that? .......any help would be greatly appreciated.

int total;
for(int row = 0; row...
Forum: Java and JSP 05-07-2012, 12:22 AM
Replies: 6
Views: 1,147
Posted By sabi
Need help with Two-Dimensional array

oh that seems complicated
Forum: Java and JSP 04-06-2012, 04:41 AM
Replies: 6
Views: 1,147
Posted By sabi
how do I display an asterisk (*) for every 100 someone has entered?

I am prompting the user for a total sales amount in dollars, such as 1200, or 900, etc. For every 100 dollars, I need to display a * character. So if the user enters 500, ***** will show on the...
Forum: Java and JSP 03-20-2012, 06:12 AM
Replies: 2
Views: 394
Posted By sabi
oh sorry wrong program

oh sorry wrong program
Forum: Java and JSP 03-20-2012, 06:02 AM
Replies: 2
Views: 394
Posted By sabi
Why does this while loop iterate

If the char variable again is initialized to 'N' then why does this loop iterate the first time

import java.util.Scanner;


public class teest
{
public static void main (String[] args)
{...
Forum: Java and JSP 03-08-2012, 04:42 AM
Replies: 2
Views: 823
Posted By sabi
How do you figure out how many times this for loop iterates?

How would you figure out how many times this for loop iterates? Instead of having to trace every step, is there another way finding out how many times a nested for loop will iterate?

for(row = 1;...
Forum: Java and JSP 02-21-2012, 05:52 AM
Replies: 0
Views: 578
Posted By sabi
How to put three names in ascending order in java using "if" or "if-else

I know you can do this with arrays and string list but i need to know how to do it with if statements
Forum: Java and JSP 02-19-2012, 06:54 AM
Replies: 3
Views: 845
Posted By sabi
but why am i getting an error at the "Logical &&...

but why am i getting an error at the "Logical && " ....are you allowed to used the logical && with equals method in java?
Forum: Java and JSP 02-19-2012, 05:47 AM
Replies: 3
Views: 845
Posted By sabi
How to put names in alphabetical order

This is what I got but im getting an error in the if statements, so can someone help me fix this?


import java.util.Scanner;

public class Alpha
{
public static void main(String[] args)
{...
Forum: Java and JSP 02-19-2012, 05:44 AM
Replies: 2
Views: 569
Posted By sabi
How to put names in alphabetical order

This is what I got but im getting an error in the if statements, so can someone help me fix this?


import java.util.Scanner;

public class Alpha
{
public static void main(String[] args)
{...
Forum: Java and JSP 02-09-2012, 09:43 PM
Replies: 1
Views: 485
Posted By sabi
How can I calculate the balance with this formula in java program

If you deposit p dollars, the money in your account after n years at an interest rate r is p (1 + r)^n


This is what I got.... Is this correct? and would I need to cast this beacause years are in...
Forum: Java and JSP 12-11-2011, 03:20 AM
Replies: 3
Views: 496
Posted By sabi
The error is at, // find the index of the...

The error is at,
// find the index of the smallest value

int s = i-1;
if (array[j].compareTo(array[s]) < 0)

Exception in thread "main" java.lang.NullPointerException
Forum: Java and JSP 12-08-2011, 07:07 AM
Replies: 3
Views: 496
Posted By sabi
I need help with storing strings in array in JAVA

This program is about storing strings in an array from a file and then using selection sort to put them in ascending order. It is required to set the array to 100, but this file only have 5 names in...
Forum: Java and JSP 12-07-2011, 05:44 AM
Replies: 1
Views: 679
Posted By sabi
Displaying numbers in java

I wrote a program that asks the user to enter a series of one-digit numbers and then it stores those numbers in a array....but now i want to print out how many times each digit the user entered.
...
Forum: Java and JSP 12-04-2011, 08:11 AM
Replies: 1
Views: 731
Posted By sabi
Program that asks the user to enter 5 numbers and then displays them at the end

im writing a program that asks the user to enter 5 numbers and then when it has all 5 numbers it should display all the numbers at the end, but i cant make it work so please help me out.

import...
Forum: Java and JSP 11-12-2011, 05:15 AM
Replies: 1
Views: 984
Posted By sabi
A code that counts the number of occurrences of one string in another, larger string.

how can i make this code so it would count the number of occurrences of one string in another, larger string.


import java.io.*;
import java.util.Scanner;

public class Read
{
public static...
Forum: Java and JSP 11-11-2011, 06:52 PM
Replies: 0
Views: 680
Posted By sabi
program that counts the number of occurrences of a substring within a file.

A program that counts the number of occurrences of a substring within a file. The program must allow the user to enter both the name of the file to be searched and the substring the user wants to...
Forum: Java and JSP 11-04-2011, 06:03 PM
Replies: 2
Views: 1,616
Posted By sabi
it didnt wok

it didnt wok
Forum: Java and JSP 11-02-2011, 09:35 PM
Replies: 2
Views: 1,616
Posted By sabi
how can I make this asterisk pattern display in java using loops

*
**
***
****
*****


Here's what I got but its not working out so please help me.....
Forum: Java and JSP 10-26-2011, 07:49 AM
Replies: 1
Views: 398
Posted By sabi
How would you read number or a letter from this input

System.out.println("Enter the first number or X to end the input: ");

double numberEntered = keyboard.nextDouble();

while (numberEntered != 'x')
{
System.out.println("You entered a...
Forum: Java and JSP 10-23-2011, 02:08 AM
Replies: 1
Views: 369
Posted By sabi
how would you read a single character in this code

import java.util.Scanner;

public class Lab5_Ex1
{
public static void main(String[] args)
{
String input;
char answer;
Showing results 1 to 25 of 27

 
Forum Jump

All times are GMT +1. The time now is 02:39 AM.