📄 while_with_if_program.adb.npp
字号:
with text_io; use text_io;with Ada.Float_text_io; use Ada.Float_text_io;procedure while_with_if_program isPrice_Per_Kilo : Float; --Price of applesKilos_Of_Apples: Float; --Apples required Cost : Float; --Cost of apples lines_output : Integer :=0; count : integer :=10;begin Price_Per_Kilo := 1.20; -- put(integer'image(count)); -- delivers count as a character string. new_line; Put( "Cost of apples per kilo : " ); Put( Price_Per_Kilo ); New_Line; Put( " Kilo's Cost" ); New_Line; Kilos_Of_Apples := 1.0;while Kilos_Of_Apples <= 10.0 loop --While lines to printCost := Price_Per_Kilo * Kilos_Of_Apples; --Calculate costPut( Kilos_Of_Apples ); --Print resultsPut( " " );Put( Cost );New_Line; Kilos_Of_Apples := Kilos_Of_Apples + 1.0; --Next value lines_output :=lines_output+1; delay 1.0; -- wait for 1 second if lines_output >=4 then new_line; lines_output :=0; end if;end loop;end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -