Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help with this weather commentor please Posted by Coolicle on 13 Oct 2012 at 7:59 AM
here is what i have so far
program Weather21;
var weather: char;
begin

writeln ('please type b for bad weather or g for good weather:');
readln (weather);
if weather := 'b'
then
writeln ('hope the weather improves')
else
writeln:= ('enjoy the nice weather');
end.

This is meant to ask whether the weather is good or not and then make a comment mad using dev-pascal please help
Report
Re: Help with this weather commentor please Posted by Actor21 on 13 Oct 2012 at 11:12 AM
: here is what i have so far
: program Weather21;
: var weather: char;
: begin
:
: writeln ('please type b for bad weather or g for good weather:');
: readln (weather);
: if weather := 'b'
: then
: writeln ('hope the weather improves')
: else
: writeln:= ('enjoy the nice weather');
: end.
:
: This is meant to ask whether the weather is good or not and then
: make a comment mad using dev-pascal please help
:

program Weather21;
var weather: char;
begin
   writeln ('please type b for bad weather or g for good weather:');
   readln (weather);
   {
      := is assignment operator, = is comparison operator
   }
   if weather = 'b'
      then
         writeln ('hope the weather improves')
      else
         writeln ('enjoy the nice weather') { get rid of := }
end.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.