Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.