This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
enum MenuSelectionEnum | |
{ | |
MENU_NONE = 0, | |
MENU_ADD = 1, | |
MENU_SUBTRACT = 2, | |
MENU_MULTIPLY = 3, | |
MENU_DIVIDE = 4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prevent multiple inclusions of header file | |
#include <iostream> | |
#ifndef RATIONAL_H | |
#define RATIONAL_H | |
using namespace std; | |
class Rational | |
{ | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "Rational.h" | |
using namespace std; | |
enum MenuSelectionEnum | |
{ | |
MENU_NONE = 0, | |
MENU_ADD = 1, | |
MENU_SUBTRACT = 2, | |
MENU_MULTIPLY = 3, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int number, right_digit; | |
printf ("Enter your number.\n"); | |
scanf ("%i", &number); | |
while ( number != 0 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.LC0: | |
.string "ay" | |
.LC1: | |
.string "\nThis is the substring: %s\n" | |
.LC2: | |
.string "The first character of the word is %s\n" | |
.LC3: | |
.string "AyEnding: %s\n" | |
.LC4: | |
.string "Your word in Pig Latin is %s\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pig Latin Translator 0.6 | |
User Enters a word after the prompt | |
and gets the "Pig Latin" version back at the | |
prompt. | |
Compilation: #cc pigLatin.c -o pigLatinProgram | |
Execution: #./pigLatinProgram | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pig Latin Translator 0.8 | |
User Enters a word after the prompt | |
and gets the "Pig Latin" version back at the | |
prompt. | |
Example Compilation and Run | |
Apoh:Documents apoh$ cc pigLatinTranslator.c -o pigLatin | |
Apoh:Documents apoh$ ./pigLatin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pig Latin Translator 0.8.2 | |
User Enters a word after the prompt | |
and gets the "Pig Latin" version back at the | |
prompt. | |
Example Compilation and Run | |
Apoh:Documents apoh$ cc pigLatinTranslator.c -o pigLatin | |
Apoh:Documents apoh$ ./pigLatin | |
Please enter a word. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Atm | |
{ | |
public static void main(String[] args) | |
{ | |
double balance = 100.00; | |
double withdrawalAmount; | |
double depositAmount; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Atm | |
{ | |
public static void main(String[] args) | |
{ | |
double balance = 100.00; | |
double withdrawalAmount; | |
double depositAmount; | |
boolean sentinelValue = true; |