CLSCOLOR 4 'RedPRINT "NO USE OF CAPITAL LETTERS!!"COLOR 2 'GreenishINPUT "What's your name"; N$SELECT CASE N$ CASE "melanie" ''OR "Melanie" PRINT "Well hello there pretty lady!" CASE "mom" PRINT "Hello mom" CASE "austin" COLOR 4 PRINT "oh great...you..." SLEEP 2 CASE "larry" PRINT "Hello dad" CASE "" PRINT "okay then...." CASE "goose" PRINT "Hello, Stone" CASE "ryan" PRINT "Hello, Goosey" CASE ELSE PRINT "Hello, "; N$END SELECTSLEEP 119 INPUT "Would you like to guess the secret number, yes or no"; Q$SELECT CASE Q$ CASE "yes" GOTO 31 CASE "no" SLEEP 1 PRINT "Fine! Leave!" END CASE ELSE PRINT "What?" SLEEP 1 GOTO 19END SELECT31 INPUT "Enter a number between 1 and 100"; SN IF SN > 0 AND SN < 10 THEN SELECT CASE SN CASE 54 PRINT "Good job!" END CASE ELSE PRINT "Wrong!"44 INPUT "Would you like to guess again, yes or no"; A$ SELECT CASE A$ CASE "yes" GOTO 31 CASE "no" GOTO 63 CASE ELSE PRINT "What?" GOTO 44 END SELECT ' IF A$ = "yes" THEN ' HAVE TO TURN THIS INTO A CASE ' GOTO 31 ' IF A$ = "no" THEN ' GOTO 49 ' END IF END SELECT END IF IF SN >= 100 THEN GOTO 31 END IF49 IF Q$ = "no" THEN COLOR 463 PRINT "Well fine! I didn't want you to anyways!"END IFSLEEP 1PRINT "Thank you for playing."END
CLSCOLOR 4 'RedPRINT "NO USE OF CAPITAL LETTERS!!"COLOR 2 'GreenishINPUT "What's your name"; N$SELECT CASE N$ CASE "melanie" ''OR "Melanie" PRINT "Well hello there pretty lady!" CASE "mom" PRINT "Hello mom" CASE "austin" COLOR 4 PRINT "oh great...you..." SLEEP 2 CASE "larry" PRINT "Hello dad" CASE "" PRINT "okay then...." CASE "goose" PRINT "Hello, Stone" CASE "ryan" PRINT "Hello, Goosey" CASE ELSE PRINT "Hello, "; N$END SELECTSLEEP 119 INPUT "Would you like to guess the secret number, yes or no"; Q$SELECT CASE Q$ CASE "yes" GOTO 31 CASE "no" SLEEP 1 PRINT "Fine! Leave!" END CASE ELSE PRINT "What?" SLEEP 1 GOTO 19END SELECT31 INPUT "Enter a number between 1 and 100"; SN IF SN > 0 AND SN < 10 THEN SELECT CASE SN CASE 54 PRINT "Good job!" END CASE ELSE PRINT "Wrong!"44 INPUT "Would you like to guess again, yes or no"; A$ SELECT CASE A$ CASE "yes" GOTO 31 CASE "no" GOTO 63 CASE ELSE PRINT "What?" GOTO 44 END SELECT ' IF A$ = "yes" THEN ' HAVE TO TURN THIS INTO A CASE ' GOTO 31 ' IF A$ = "no" THEN ' GOTO 49 ' END IF END SELECT END IF IF SN >= 100 THEN GOTO 31 END IF49 IF Q$ = "no" THEN COLOR 463 PRINT "Well fine! I didn't want you to anyways!"END IFSLEEP 1PRINT "Thank you for playing."END
CLSCOLOR 4 'RedPRINT "NO USE OF CAPITAL LETTERS!!"COLOR 2 'GreenishINPUT "What's your name"; N$SELECT CASE N$ CASE "melanie" ''OR "Melanie" PRINT "Well hello there pretty lady!" CASE "mom" PRINT "Hello mom" CASE "austin" COLOR 4 PRINT "oh great...you..." SLEEP 2 CASE "larry" PRINT "Hello dad" CASE "" PRINT "okay then...." CASE "goose" PRINT "Hello, Stone" CASE "ryan" PRINT "Hello, Goosey" CASE ELSE PRINT "Hello, "; N$END SELECTSLEEP 119 INPUT "Would you like to guess the secret number, yes or no"; Q$SELECT CASE Q$ CASE "yes" GOTO 31 CASE "no" SLEEP 1 PRINT "Fine! Leave!" END CASE ELSE PRINT "What?" SLEEP 1 GOTO 19END SELECT31 INPUT "Enter a number between 1 and 100"; SN IF SN > 0 AND SN < 10 THEN SELECT CASE SN CASE 54 PRINT "Good job!" END CASE ELSE PRINT "Wrong!"44 INPUT "Would you like to guess again, yes or no"; A$ SELECT CASE A$ CASE "yes" GOTO 31 CASE "no" GOTO 63 CASE ELSE PRINT "What?" GOTO 44 END SELECT ' IF A$ = "yes" THEN ' HAVE TO TURN THIS INTO A CASE ' GOTO 31 ' IF A$ = "no" THEN ' GOTO 49 ' END IF END SELECT END IF IF SN >= 100 THEN GOTO 31 END IF49 IF Q$ = "no" THEN COLOR 463 PRINT "Well fine! I didn't want you to anyways!"END IFSLEEP 1PRINT "Thank you for playing."END
if ( foo = bar )
if ( constant == variable )
if ( foo = bar )
if ( constant == variable )
using System;using System.Collections.Generic;namespace conFibonacciSequence{ class Program { static void Main() { int SequenceCount = DetermineSequenceLength(); if (SequenceCount >= 2) { GenerateSequence(SequenceCount); } else { Console.WriteLine("Invalid input."); Main(); } } static int DetermineSequenceLength() { int Value; Console.Write("How many values would you like to calculate (min: 2): "); Value = http://forums.bethsoft.com/index.php?/topic/1092028-unofficial-programming-thread/int.Parse(Console.ReadLine()); return Value; } static void GenerateSequence(int Count) { ListFibNumber = new List (); int FibSum = 0; for (int i = 1; i < Count; i++) { if (FibNumber.Count == 0) { FibNumber.Add(0); FibNumber.Add(1); } FibSum = FibNumber[i] + FibNumber[i - 1]; FibNumber.Add(FibSum); } for (int i = 0; i < FibNumber.Count; i++) { Console.WriteLine(FibNumber[i].ToString()); } Console.ReadLine(); } }}
#include#include #include #include #include using namespace std;int main(int argc, char *argv[]){ float x = 0; float y = 0; char dmas;for (;;){do { cout<<"Divide (/), multiply (*), add (+), or subtract (-)? Press q to quit.\n\n"; cin>> dmas; switch (dmas) { case '/': cout<<"\nInput a number to be divided.\n\n"; cin>> x; cout<<"\nInput a number to divide by.\n\n"; cin>> y; if (y == 0){ cout<<"\nYou can not divide by zero."; y = 1;} cout<<"\n" << x / y << "\n\n"; break; case '*': cout<<"\nInput a number to be multiplied.\n\n"; cin>> x; cout<<"\nInput a number to multiply by.\n\n"; cin>> y; cout<<"\n" << x * y << "\n\n"; break; case '+': cout<<"\nInput a number to be added.\n\n"; cin>> x; cout<<"Input a number to add.\n\n"; cin>> y; cout<<"\n" << x + y << "\n\n"; break; case '-': cout<<"\nInput a number to be subtracted from.\n\n"; cin>> x; cout<<"Input a number to subract.\n\n"; cin>> y; cout<<"\n" << x - y << "\n\n"; break; case 'q':break; default: cout<<"\nThat isn't a valid entry.\n\n"; break; }}while (dmas != 'q');} return 0;}