Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,589 members, 7,809,129 topics. Date: Friday, 26 April 2024 at 12:27 AM |
Nairaland Forum / Science/Technology / Programming / Who Can Write This C Program (1533 Views)
Help! Im Stuck With This C# Program / Please Programmars Help Me Out With This C# Program! I Have Test Tommorrow!!!!! / A Simple C++ Program That Evaluates A Simple And Compound Interest (2) (3) (4)
Who Can Write This C Program by subi: 9:56am On Apr 17, 2009 |
Pls am having problem writing this program who can help me out 1. Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price. 2. program that can merger 2 files into one. 3. Program that will count the total odd and even number btw 1 and 100 4. A program that can accept data into a file and it should prit it in reverse order and it will transfer only the vowel data into a file. Please if you can help me on how to go abt this questins kindly reply me invltd@yahoo.com And tell me ur terms, as this is urgent |
Re: Who Can Write This C Program by jacob05(m): 4:21pm On Apr 21, 2009 |
This is why i love Python, simple apps that can be written in a clean and fine language . And about your C app i will see what i can do about that. My advice . learn Python |
Re: Who Can Write This C Program by Frizy(m): 9:54pm On Apr 21, 2009 |
subi: hey, I would help you solve the problems but please don't tell anyone. I suspect this is a school assignment. If caught, this is called cheating, and am liable to penalties myself. |
Re: Who Can Write This C Program by Frizy(m): 9:55pm On Apr 21, 2009 |
3. Program that will count the total odd and even number btw 1 and 100 //Program that will count the total odd and even number btw 1 and 100 #include<iostream> #include<iomanip> using namespace std; int main() { int even=0; int odd=0; for(int i=1;i<=100;i++) { if (i%2==0) { even++; } else odd++; } cout<<"The number of Odd and Even between 1 to 100 is"<<setw(5)<<odd<<"Odds"<<setw(5)<<even<<"evens"<<endl; return 0; } |
Re: Who Can Write This C Program by Frizy(m): 10:58pm On Apr 21, 2009 |
1. Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price. /*Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price*/ #include<iostream> #include<string> #include<iomanip> using namespace std; int min_price (int quantity[], int size); string return_item(string item_names,int quantity[], int size); int main() { string item_names; float price; int times=0; do { cout<<"Item name?"<<endl; cin>>item_names; cout<<"price"<<endl; cin>>price; times++; }while(times!=5); int min_price (int arrays[], int length); string return_item(string item_names,int quantity[], int size); return 0; } //Display in descending order of price int size=5; int min_price(int quantity[], int size) { int min = quantity[0]; for (int i=1; i < size; i++) if (quantity[i] < min) min = quantity[i]; return min; } //display the itms names with the hishest price string return_item(string item_names,int quantity[], int size) { cin>>item_names; int max = quantity[0]; for (int i=1; i < size; i++) { if (quantity[i] > max) max = quantity[i]; return item_names; } } |
Re: Who Can Write This C Program by Frizy(m): 11:03pm On Apr 21, 2009 |
Now I may or may not continue tomorrow, it really depends on my mood. |
Re: Who Can Write This C Program by IbrahimB: 5:44pm On Apr 23, 2009 |
@Frizy: Well done! I think the way you solved the odd/even problem is quite elegant. (Even though the solution you gave was actually C++ and not C) Probably he's found a solution, coz sent him an email and he hasn't replied. Ibrahim |
Re: Who Can Write This C Program by Frizy(m): 6:04pm On Apr 23, 2009 |
IbrahimB: Thanks man, maybe he found a solution. Are you a cs student |
Re: Who Can Write This C Program by IbrahimB: 6:30pm On Apr 23, 2009 |
@Frizy: I'm a Software Developer though a graduate of EE Engineering |
(1) (Reply)
Help Him Create Interdependent Fields Microsoft Access / Learn Rust - Build Fast, Safe And Concurrent Programs Without Tears / Need A Software
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19 |