### How JustAnswer Works:

• Ask an Expert
• Get a Professional Answer
• 100% Satisfaction Guarantee

## Ask LogicPro Your Own Question

LogicPro, Engineer
Category: Homework
Satisfied Customers: 12260
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now

# QUESTION 1You are given a table that shows the total number

This answer was rated:
QUESTION 1

You are given a table that shows the total number of cars sold by a local car distributor in Johor Bharu for the first six months in 2008.

Month Jan Feb Mar Apr May Jun
Number of cars sold 191 196 269 308 236 145

Based on the table given above, you are required to write a C program using array to store all the information given above, determine and display the sum of all the odd numbers in the array.

(20 marks)

Anda diberikan jadual yang menunjukkan jumlah jualan kereta bagi sebuah pengedar kereta tempatan di Johor Bharu dalam tempoh enam bulan yang pertama bagi tahun 2008.

Bulan Jan Feb Mar Apr May Jun
Bilangan kereta yang dijual 191 196 269 308 236 145

Berdasarkan jadual yang diberikan di atas, anda dikehendaki untuk menulis aturcara C dengan menggunakan tatasusunan untuk menyimpan semua maklumat di atas, menentukan dan memaparkan jumlah kesemua nombor ganjil dalam tatasusunan berkenaan.

QUESTION 2

By using linked list, Write a complete C program that accepts few integers, traverses it, and returns the data in the linked list that has the smallest value. Then, write a function to reverse the data that already exists in the linked list.

The Createlist(), NewNode(), InsertNode() and TraverseList() functions that you may use in your solution are elaborated in the module.

Sample output:
Enter integers: 23 12 34 56 78 12
Traversing the list : 23->12->34->56>78->12
Minimum value : 12
Reversing the list: 12->78->56->34->12->23

(40 marks)
(Total: 60 marks)
Hi,
Welcome here.
My name is XXXXX XXXXX I will help you.
What is the deadline?
Customer: replied 2 years ago.

the deadline is 22/10/2013

ok. Please check back in 12 hours for answer.
Book mark this page to come back later on
Customer: replied 2 years ago.

ok.thank you

Welcome
Download answer #1 from here: Cars_Sold.c
Download answer #2 from here: LinkedList_C.c

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/computer/expert-logicpro/

so you can come back and ask me a question anytime.

Remember, if you need anything else, we can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions at no extra charge and I’m always here to help.

Thank you for using this site!

LogicPro, Engineer
Category: Homework
Satisfied Customers: 12260
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
LogicPro and other Homework Specialists are ready to help you
Customer: replied 2 years ago.

can u give some explanation of the two scenario in word please bcoz i have to present this assignment in front of tutor and i will be some questions on how i did this assignment

ok, please wait.
Download from here: car explanation.docx
Customer: replied 2 years ago.

sir in question 1 you have to display the month for the odd number of car sold then only sum it.

example:

Month Jan Mar Jun
Number of cars sold(Odd) 191 269 145

then only display sum of all the odd numbers in the array.

ok. Please wait
Download again from here: Cars_Sold.c
Customer: replied 2 years ago.

sir i want to ask char months [6] explain the months

[20] explain what?

In C, to declare string, you need to take char array. To store more than one strings, you need to take array of strings. It means array of char arrays

so months[ 6 ][ 20 ] means, 6 strings of 20 characters

Hi again,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro
Hi again,
Just following up with you to see how everything is going and if you have more questions for me.
You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.
It will ensure that question is for me.
Please bookmark my profile page:
http://www.justanswer.com/homework/expert-logicpro/
so you can come back and ask me a question anytime.
If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.
I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!
Thanks very much for using Just Answer!
Best wishes
LogicPro
Customer: replied 2 years ago.

sir can i ask few questions regarding the assignment u have done for me

let me know the question.
Customer: replied 2 years ago.

include<stdio.h>

typedef struct Node

{

int data;

struct Node *next;

}node;

void insert(node *pointer, int data)

{

/* Iterate through the list till we encounter the last node.*/

while(pointer->next!=NULL)

{

pointer = pointer -> next;

}

/* Allocate memory for the new node and put data in it.*/

pointer->next = (node *)malloc(sizeof(node));

pointer = pointer->next;

pointer->data = data;

pointer->next = NULL;

}

void TraverseList(node *pointer)

{

int x=0;

while(pointer!=NULL)

{

if (x == 1)

{

printf(" --> %d ",pointer->data);

}

else

{

printf("%d ",pointer->data);

x=1;

}

pointer=pointer->next;

}

}

int GetSmallestValue(node *pointer)

{

int smallest = 9999999;

while(pointer!=NULL)

{

if (smallest>pointer->data)

smallest = pointer->data;

pointer = pointer -> next;

}

return smallest;

}

node * ReverseList(node *ptr)

{

node * temp;

node * previous = NULL;

while(ptr != NULL) {

temp = ptr->next;

ptr->next = previous;

previous = ptr;

ptr = temp;

}

return previous;

/// ptr = previous;

}

int main()

{

int num;

node *start,*temp;

start = (node *)malloc(sizeof(node));

temp = start;

temp -> next = NULL;

printf("Enter element to add in linked list (-1 to end): ");

scanf("%d", &num);

while (num!=-1)

{

insert(start,num);

printf("Enter element to add in linked list (-1 to end): ");

scanf("%d", &num);

}

printf("Traversing the list: ");

TraverseList(start->next);

printf("\nMinimum value : %d", GetSmallestValue(start->next));

printf("\n");

start->next = ReverseList(start->next);

printf("Reversing the list: ");

TraverseList(start->next);

return 0;

}

in the coding above whats the meaning of i) typedef struct node ,

ii) whats the meaning of temp

iii) why the reverse list got node and not data type like int , get smallest value and etc.

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

is struct Node *next ------->refers to new node izzit.

what is the difference between struct Node and node

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

do u mean the usage of capital N in Node is the same as smaller n in node ah

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

typedef struct Node

{

int data;

struct Node *next;

}node; <------------ why there is a node after the struct has been closed

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

void TraverseList(node *pointer)

{

int x=0;

while(pointer!=NULL)

{

if (x == 1)

{

printf(" --> %d ",pointer->data);

}

else

{

printf("%d ",pointer->data);

x=1;

}

pointer=pointer->next;

}

}

whats the meaning of the above statement sir

My apologies but such type of tutoring is not possible in QA mode. I can provide you only code here.
If you have some other questions, you can post a new question using "For LogicPro only", I will be happy to help you.
Thank you.
Customer: replied 2 years ago.

but sir this is the same assignment you did for me and for certain part you didn't write any comment thats why i feel difficult to understand..i have presentation tomorrow so pls help me.

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

void TraverseList(node *pointer)

{

int x=0; ------------------> whats the meaning of this statement sir

while(pointer!=NULL)

{

if (x == 1) ------------------> whats the meaning of this statement sir

{

printf(" --> %d ",pointer->data);

}

else

{

printf("%d ",pointer->data);

x=1; ------------------> whats the meaning of this statement sir

}

pointer=pointer->next;

}

}

i have asked question based on the code..pls refer to the bold and underline words.thnk u.

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.

i dont understand what you mean sir..x is used to check whether the element is first element of list.If it is ,do not print --> else print -->what u mean by first element

THIS ANSWER IS LOCKED!

You need to spend \$3 to view this post. Add Funds to your account and buy credits.

### JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

### What Customers are Saying:

• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Previous | Next >
• Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
• This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
• Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
• I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
• Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
• Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
• He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX

• ### LogicPro

#### Satisfied Customers:

4925
Expert in Java C++ C C# VB Javascript Design SQL HTML
< Last | Next >
• http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

### LogicPro

#### Satisfied Customers:

4925
Expert in Java C++ C C# VB Javascript Design SQL HTML
• http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

### Manal Elkhoshkhany

#### Satisfied Customers:

4538
More than 5000 online tutoring sessions.
• http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

### Linda_us

#### Satisfied Customers:

3138
Post Graduate Diploma in Management (MBA)
• http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

### Chris M.

#### Satisfied Customers:

2602
Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
• http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

### F. Naz

#### Satisfied Customers:

2126
Experience with chartered accountancy
• http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

### Bizhelp

#### Satisfied Customers:

1887
Bachelors Degree and CPA with Accounting work experience
• http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

### Seanna

#### Satisfied Customers:

1781
3,000+ satisfied customers, all topics, A+ work