Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 04.10.2010, 12:05   #1
bido
Новичок
Джуниор
 
Регистрация: 03.10.2010
Сообщений: 4
По умолчанию маленькие программы в ibm architect

Помогите плиз сделать хотя бы несколько из этих заданий, а то я никак не могу разобраться.

1. Write a program that reads an integer max from the keyboard. If the number are greater than 100, the program writes a random integer to the screen, taken from interval [0;max] (both numbers included). Otherwise it prints an error-message containing the number written by the user.

2. Write a method public String numberToText (int t), thattakes a parameter t between 1 and 6 and returns a text, corresponding to the number. Ex: if t equals 2. it will return "Two". If the number recieved is outside the interval, it returns the text "Outside interval".
Yand in: Just a method (not a whole program!)

3. Write a program that reads numbers from the keyboard until it recieves a number<0. It then prints the sum of the numbers read before the 'stop'-number.

4. As you should know,there are 3 different loop-constructions in Java. Rewrite at least one of the following loops to the 2 other possible forms. Please state which one you have rewritten.
A: for(int i=-2; i<10;i++)
system. out.println(i);

B: int i = 10
while(0<i)
{
System.out.println(i);
i/=2;
}

C: int i = 3
do
{
System.out.println(i);
i+=3;
} while(i<=10);

Последний раз редактировалось bido; 04.10.2010 в 12:18.
bido вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Assembler для IBM oxi Assembler - Ассемблер (FASM, MASM, WASM, NASM, GoASM, Gas, RosAsm, HLA) и не рекомендуем TASM 3 25.02.2010 08:26
Помогите написать маленькие программы для школьника Sava95 Фриланс 8 22.11.2009 23:06
поменять большие буквы на маленькие и маленькие на большие в си++ Барби Помощь студентам 4 08.04.2008 01:25
Delphi + IBM DB2 zetrix БД в Delphi 0 30.10.2006 12:57