Machine Problem
Write a program that uses ng-app directive that will ask the user to give a number and then the program will display the original, and reverse arrangement of the given number by the user.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Please subscribe to my channel https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg
Program Listing
<!-- index.htm Author : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT Date : July 26, 2021 Monday 1:08 PM Place : Bacolod City, Negros Occidental Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com Email : jakerpomperada@gmail.com --> <html> <head> <title>Reverse a Number Using ng-app in AngularJS</title> </head> <style> body { font-family: "arial"; font-style: bold; font-size: 18px; } </style> <script type="text/javascript" src="angular.min.js"></script> <body><br> <h3>Reverse a Number Using ng-app in AngularJS</h3> <body> <div ng-app="myApp" ng-controller="myController"> Give a Number <input type="number" ng-model="val_number" /> <br/><br> <button ng-click="Reverse_Number()" title="Click here to reverse the given number.">Ok</button> <br><br> {{original_number}} <br/><br> {{reverse_number}} </div> <script> var ngApp = angular.module('myApp', []); ngApp.controller('myController', function ($scope) { $scope.Reverse_Number=function() { var a,b,temp=0,reverse_number=0; var original_number=0, display=0; display = $scope.val_number; b=$scope.val_number; while($scope.val_number>0) { a=$scope.val_number%10; $scope.val_number=parseInt($scope.val_number/10); temp=temp*10+a; } $scope.original_number ="The original number is " + display +".";; $scope.reverse_number ="The reverse number is " + temp +"."; } }); </script> <br> </body> </html> </body> </html>
No comments:
Post a Comment