Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 4 - Recursive Forum Posts Each message in an on-line forum is captured with a unique message ID, a parent ID, and the text

image text in transcribedimage text in transcribed

Assignment 4 - Recursive Forum Posts Each message in an on-line forum is captured with a unique message ID, a parent ID, and the text of the message The parent ID is the message ID of another message to which a message is replying (see Figure1). The first message will have a parent ID of 0, indicating that it is not replying to any message (i.e., it is a new discussion) There could be more than one discussion in a forum! Loops, beginner Hello I am a beginner in Java and had a question regarding Loops, This message would have a parent ID of O the question in the book asks for The sum of all odd digits of n. (For examplo, if n is 32677, the sum would be 3+7+7-17 I can't quite figure out how to code that I am looking for someone to help me out. What I have is this Any help would be appreciated public class sunoFOddsInNumber code, weil the first step but I dont know how to complete it or whether I have it right or wrong public static void nain(Stringl args) int n String valse String.value0f (number); int length value.length)i while (n length) ..YTak sf this the right first step, ho do I start st? where do i share improve this question asked Sep 2 "13 at 21 49 Cant see me '?180 15.16 These messages are replying to the message above. Their parent ID would be the message ID of the message above It's not bad as a first step but where if's number deined? Have a look at the charAt method and consider using the mod (%) Operator 10 determine r a dig tis odd or even,-.ornwark 1 3 Sep 2 ,13 at 21 55 Ach! I totally misread this quession. I hought you were tyling to sun every odd number rom 1 to nt Oops Aihead Apr 11 15 at 15:28 Figure 1: Forum post example from StackOverflow.com All messages are stored in a file in the following format messagelDIparentlDItext where each message is on a separate line and the pipe (I) is a delimiter separating the fields lask Note: All classes written for this assignment must include Java documentation comments. (1) Create an appropriate class or set of classes to encapsulate the messages (e.g., a Message class) (2) Create an application (i.e., a class with a main in it, right?) where the messages are read in from a file named msg.txt" and displayed in a nesting hierarchical structure that shows the relationship of the messages (i.e., each reply is displayed on a separate line, indented by 2 white spaces relative to the message being replied to) Remember to document your code using Javadoc comments

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics And Quality Management Fundamental Tools

Authors: Joseph Nguyen

1st Edition

B0CNGG3Y2W, 979-8862833232

More Books

Students also viewed these Databases questions