sandeep17199117
BAN USER- 0of 0 votes
AnswersA spreadsheet consists of a two-dimensional array of cells, labeled A1, A2, etc. Rows are
- sandeep17199117 in United States
identified using letters, columns by numbers. Each cell contains either an integer (its value) or
an expression. Expressions contain integers, cell references, and the operators '+', '-', '*', '/'
with the usual rules of evaluation – note that the input is RPN and should be evaluated in stack
order.
Write a program (in C, C++ or Java) to read a spreadsheet from ‘stdin’, evaluate the values of
all the cells, and write the output to ‘stdout’.
The spreadsheet input is defined as follows:
• Line 1: two integers, defining the width and height of the spreadsheet (n, m)
• n*m lines each containing an expression which is the value of the corresponding cell
(cells enumerated in the order A1, A2, A<n>, B1, ...)
Your program must output its data in the same format, but each cell should be reduced to a
single floating-point value. For example, we would expect the following expect to produce the
indicated output:
Input Expected Output
3 2
A2
4 5 *
A1
A1 B2 / 2 +
3
39 B1 B2 * /
3 2
20.00000
20.00000
20.00000
8.66667
3.00000
1.50000
The above example input visually looks like:
| 1 | 2 | 3 |
--+-------------+-------+--------------+
A | A2 | 4 5 * | A1 |
--+-------------+-------+--------------+
B | A1 B2 / 2 + | 3 | 39 B1 B2 * / |
------------------------+--------------+| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures
- 1 Answer Google Question
Most people have adopted the decimal number system which has ten symbols (0,1,2,3,4,5,6,7,8,9). There are other number systems like binary, hex and octal. Your job is to convert a hex number into a musical number. What is a musical number you might ask? It’s something we invented. Keep reading.
- sandeep17199117 November 26, 2013
The Hex alphabet contains 16 symbols: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
The Musical alphabet contains 12 symbols: A,A#,B,C,C#,D,D#,E,F,F#,G,G# (# is pronounced 'sharp' so 'A#' is pronounced 'A-sharp', 'C#' is 'C-sharp' and so on)
Your program should validate input (make sure input is a hex number i.e. it is in base-16) and convert it to a number represented by the musical alphabet (base-12). Your program should output the musical number OR an error string "Input is not valid Hex" if the input is not valid hex| Flag | PURGE - 0 Answers Data Structures
A spreadsheet consists of a two-dimensional array of cells, labeled A1, A2, etc. Rows are
- sandeep17199117 February 01, 2013
identified using letters, columns by numbers. Each cell contains either an integer (its value) or
an expression. Expressions contain integers, cell references, and the operators '+', '-', '*', '/'
with the usual rules of evaluation – note that the input is RPN and should be evaluated in stack
order.
Write a program (in C, C++ or Java) to read a spreadsheet from ‘stdin’, evaluate the values of
all the cells, and write the output to ‘stdout’.
The spreadsheet input is defined as follows:
• Line 1: two integers, defining the width and height of the spreadsheet (n, m)
• n*m lines each containing an expression which is the value of the corresponding cell
(cells enumerated in the order A1, A2, A<n>, B1, ...)
Your program must output its data in the same format, but each cell should be reduced to a
single floating-point value. For example, we would expect the following expect to produce the
indicated output:
Input Expected Output
3 2
A2
4 5 *
A1
A1 B2 / 2 +
3
39 B1 B2 * /
3 2
20.00000
20.00000
20.00000
8.66667
3.00000
1.50000
The above example input visually looks like:
| 1 | 2 | 3 |
--+-------------+-------+--------------+
A | A2 | 4 5 * | A1 |
--+-------------+-------+--------------+
B | A1 B2 / 2 + | 3 | 39 B1 B2 * / |
------------------------+--------------+| Flag | PURGE