Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

need help with calculation in my spreadsheet array  RSS feed

 
Greenhorn
Posts: 2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im currently making a spreadsheet that calculate user input and puts the row, column,values,total in the spreadsheet and im trying to store the formula in the cell but im having problems doing so can some one help me out??

heres my code:
 
Java Cowboy
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you explain in more detail what aspect of it you exactly have problems with? Do you get any error messages; if yes, then what exactly are the error messages? Does the program run, but doesn't it do what you expect - if yes, then how does what it actually does differ from what you expect?
 
Ron Edgerson
Greenhorn
Posts: 2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so if does give me a error yet, nonetheless, here is my output:

Enter the Cell Column, Row, and Value:
a 0 3.4 b 0 3.4 + c 0
3.4 + 3.4 = 6.8

A B C D E F G
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
0 | 3.400 | 3.400 | 6.800 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
1 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
2 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
3 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
4 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
Enter to change the row and col:
A 0 2.333
2.333 + 3.4 = 5.7330000000000005

A B C D E F G
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
0 | 2.333 | 3.400 | 6.800 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
1 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
2 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
3 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|
4 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| ---------| ---------| ---------| ---------| ---------| ---------| ---------|


Now i ask the user to input column, row number, value, and then column two, row number 2, value two, operator, and then store the total in the cell specified. which it does store the correct total in the first prompt, but when i ask the user to change the value in column A , row 0 , the new value is store but the total will not change ( which it suppose to change from 6.8 to 5.7).
im not sure how to get the new total to store??
 
Screaming fools! It's nothing more than a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!