Script that will repetitively ask user for a binary number

Assignment Help Computer Engineering
Reference no: EM13703763

Question: You were just hired for a summer internship with one Atlanta's best software companies; however, on your first day of work you learn that for the next 3 months, the only job you will have is to convert binary (base 2) numbers into decimal numbers (base 10). You decide to write a script that will repetitively ask the user for a binary number and return its decimal equivalent until an illegal number (one containing digits other than 0 or 1) is entered.

The number entered should contain only the digits 0 and 1. The rightmost digit has the value 2 and the digit N places to the left of that has the value 2N.

For case: entering 110101 returns 53 = 25 + 24 + 22 + 20 you must use iteration to solve this problem. 

Note: The input (...) function prompts the user for a value and returns the numerical result.

You have to satisfy the requirements specific in the instruction. I cannot seem to get this to work for some reason could somebody provide me solution?

Reference no: EM13703763

Questions Cloud

Find a seating assignment for members of this group : Given a round table with ten chairs and a group of ten people, some of whom are married and some of whom do not like each other,
Set of nested for loops : Use a set of nested for loops to display the letters "R" and "B" in patterns as they might appear on a checkerboard.
Example for a dynamic network : A TCL Script to show an example for a dynamic network where the routing adjusts to a link failure.
Compute the area of the triangle : Compute the area of the triangle using Heron's Formula(below), in which s represents half of the perimeter of the triangle, and a,b, and c, represent the length of the three sides.
Script that will repetitively ask user for a binary number : write a script that will repetitively ask the user for a binary number and return its decimal equivalent until an illegal number (one containing digits other than 0 or 1) is entered.
Create a third string consisting of the first half of string : Show the length of both strings - Create a third string consisting of the first half of string (1) and the second half of string.
Direct recursion : Procedure A calls Procedure B then, based on the result of Procedure B, may call Procedure A.  Procedure B checks to see if the specific case it is being passed has already been solved; if so, it returns with the answer.  This is most closely an e..
Implementation of the vector data type : Described in general terms the implementation of the vector data type. Complete the implementation of the vector by providing definitions for the subsequent operations
Relation between the objects : What will be said about the relation between the objects object1 and object2 - Make this program using java programming.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Suppose that screen is an ostream iterator initialized

What is the output of the following program segment? (suppose that screen is an ostream iterator initialized to the standard output device to output elements of the type int.)

  Functional specifications for the software at workplace

what are two of the most important methods to examine and why.

  Describing the structure

Suppose that a new type known as POINT has been described-- it is a structure consisting of the two fields, x and y, both of type double. Suppose two variables p1 and p2 of kind POINT have been declared.

  Part-11 how can you perform a oating point comparison you

part-11. how can you perform a ?oating point comparison? you should include two examples one in c-shell and one in

  How to releasing the memory using the delete operat

In class, we have been discussing creating objects using the new operator and releasing the memory using the delete operator. Two other similar operators are new[] and delete[]. These operators work the similar as the new and delete but with arrays..

  Illustrate the difference between the throwing an exception

question 1 what is the difference between throwing an exception and catching an exception?question 2 how does a method

  What is total capacity of a track

What is total capacity of a track

  How to concern about personal privacy, efficiency

How to concern about personal privacy, efficiency

  Elements of physical security

Develop a physical security plan for manufacturing company. Your paper must include an explanation of the physical security and the different elements of the physical security.

  Write down program for a bank account

Write down program for a bank account

  Prompts the user to enter the number of students

Write down a Java program that prompts the user to enter the number of students and each student's name and score, and finally displays the student with the highest score and the student with second-highest score.

  Electricity and magnieism state and explain ampere law

state and explain ampere law ? ltbrgtstate and explain biot savert law ? ltbrgtstate and explain ohm3939s law ?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd