Skip to content

This program swaps the second and last digit of an inputted 3-digit number, and outputs both the inputted number and converted number to the console and as an alert.

Notifications You must be signed in to change notification settings

nicholedobbin/NumberSwap_ControlStructures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Swap Numbers with Conditionals and Loops

IFSL1T07 - Beginner Control Structures — Loops

Description

This program uses a for loop and nested 'if..else if..else' statement that prompts the user to enter a number of 3 digits or more. The program then swaps the second and last digit of the inputted number, and outputs both the inputted number and converted number to the console and as an alert.


Installation and Setup

  1. Clone the repo and open with your preferred IDE (e.g. VSCode).
  2. In the IDE, open the swapping.html file and click the 'run' button, or click 'Go Live' if using VSCode. This should open your browser automatically to your localhost port with '/swapping.html' as the URL endpoint.

How to Use

  1. Once the html file is loaded in your browser, a popup window will appear asking you to enter a number at least 3 digits long.
  2. One you have entered the number, another popup will appear with the swapped number.

Credits & References

I created this project myself as part of my Hyperiondev course: Immersive Full Stack Web and Software Engineer (Level 1, Task 7), using the following websites for reference.

About

This program swaps the second and last digit of an inputted 3-digit number, and outputs both the inputted number and converted number to the console and as an alert.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published