This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

need help with calculation in my spreadsheet array

 
Greenhorn
Posts: 2
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Do not threaten THIS beaver! Not even with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic