2012-10-24 29 views
0

所以我剛剛開始在大學學習處理,但不幸的是錯過了幾次講座,所以對於手頭的課本,我試圖學習這個我的自我,有人可以讓我知道如果我對這或對嗎?你會拯救我的生命。有點..感謝:d處理語言 - 編寫數據的基本程序

這是一個問題:

寫一個程序,聲明並與他們的價值觀初始化以下變量 。將註釋添加到您的程序中以分開 不同的小節。一世。 noOfstudents = 50 ii。 examMark = -50
iii。 priceOfShoes = 59.99 iv。收入= 10,750.99 v。 greetingMessage ='你好那裏'vi。字母表= 'A'

VII lossOfIncome = -20.30
VIII總和= 0.0000000000076

,這是我已經輸入了對問題的代碼;

void setup() { 
int noOfStudents; 
noOfStudents = 50; //Number of Students 
float examMark; 
examMark = -50; // Exam Mark 
float shoePrice; 
shoePrice = 59.99; // The price of the shoes 
double income; 
income = 10750.99; // The income 
print ("hello world"); //displays hello world 
char message; 
message = 'A'; //displays the character A 

float lossOfIncome = -20.30; 
double lossOfIncome2 = 0.0000000000076; //The loss of income 

} 

回答

0

您可以在一行上聲明並初始化您的變量,即int noOfStudents = 50;。此外,您正在使用print()方法。您更希望使用String變量類型。

你可能也想看看Ch。丹尼爾Shiffman的4,學習處理書,或至少ch的例子。 4在線。

http://www.learningprocessing.com/examples/

+0

非常感謝負載!我有丹尼爾Shiffmans從uni貸款的書,所以將檢查chap4。再次感謝! –