Tags:
tag this topic
create new tag
view all tags
---+Fourth Lab ---++Learning Objective(s) 1. Learn the <b>for</b> loop 1. Be able nest loops 1. Be able to format output well 1. Use a switch statement 1. Learn something on your own. ---++Overview of the Program This lab involves creating an arithmetic table. You are to allow the user to specify which operation (+, -, *, /) and the size of the table. ---++Specifics ---+++Major components 1. The program should be called <b>Tables</b> 1. The user will input a letter/word indicating which operation (add, subtract, multiply, divide). But they may misspell it and/or allowed to use upper or lower case letters. So only use the first letter. 1. Use integer arithmetic for all the operations. 1. The user can specify the size of the table (up to 99) 1. The table must be nicely aligned ---+++Things to learn on your own Google can be a significant help here. Also, your textbooks can help. 1. How to get the first letter of the string 1. How to format the output with a variable amount of spaces ---+++Sample output Simplest sample result if it is an addition table for 1 - 5 is as follows. Feel free to make your table even nicer if you want. <pre> + 1 2 3 4 5 1 2 3 4 5 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 </pre> ---++Submission 1. Create an empty zip folder. 1. Place your program (.java file) in it 1. Place your software development report in it. 1. Submit the zip folder on canvas ---++Optional improvements 1. Add an additional operation 1. Allow for floating point in the division (outputting at most 3 digits are the decimal point) 1. Work in base 8 (doing all base work yourself). This is a MAJOR challenge and is only included for those that are extremely bored!
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2021-12-27
-
cathybareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback