Help with this weather commentor please - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help with this weather commentor please

CoolicleCoolicle Posts: 1Member
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

Comments

  • Actor21Actor21 Posts: 35Member
    : 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
    :

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

Sign In or Register to comment.