/* * File: main.cpp * Author: TBuchli * * Write a program that helps a real estate agent calculate an average price of *up to 20 homes. An array of data type double should be used to contain the *prices. The program should prompt the user to enter the number of prices to *average — a maximum of 20 prices. * * Then, the program should prompt the user to enter each price. Once all of the *prices have been entered into the array, sort them in ascending order. The *output should include a listing of the prices entered, and …

Member Avatar
Member Avatar
+0 forum 4

Please help me!I want the code for doing following task in perl. Task is that "Read the paragraph from a file and print it in another file in ascending(total number of words in a sentence) order." My sample task: If the input "Hi! my name is Sarma. Can you help?" Output should be "Hi! Can you hepl? my name is Sarma." I could try this. It prints the number of words in a each sentence. My code is: #!/usr/local/bin/perl use strict; use warnings; my ($line,$inFile,$outFile,$para, $text, @sentences, @words, @length, $count, $i, $order); #defined variables $inFile = "name.txt"; $outFile = "out.txt"; …

Member Avatar
Member Avatar
+0 forum 2

Not sure if I posted correctly. I am trying to do a bubble sort on a 2D array. I want to sort the array by columns. I get it to compile but it doesn't run correctly. #include <iostream> using namespace std; int main() { int array[10][10]; int col, row; cout<<"Enter numbers to put into row "; for(int i = 0; i < 9; i++){ cin>>row; cout<<"Enter the numbers to put into column "; for(int j = i+1; j < 10; j++){ cin>>col; array[i][j]; } } int maxIndex; for(int i=0; i<size-1;i++) { maxIndex=i; for(int j=i+1;j<size;j++){ if(a[j][col] > a[maxIndex][col]) maxIndex=j; } if(a[i][col] …

Member Avatar
Member Avatar
+0 forum 4

[CODE]void merge() { if(start==NULL) { start=start2; } else { temp=start; while(temp->next!=NULL) { temp=temp->next; } temp->next=start2; } temp=start; if(start==NULL) printf("\nList is empty"); else { printf("\nElements of the list:\n"); while(temp!=NULL) { printf("%d\t",temp->info); temp=temp->next; } } system("pause"); system("cls"); main(); }[/CODE] the following code is use to merge two linked list into one and output to user the new merged list...i want to sort the integer values in ascending order and print out them to the user in this function. i mean sorting taking place inside the function.

Member Avatar
Member Avatar
+0 forum 1

[CODE]public class Array { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String ctr=""; int size= Integer.parseInt(JOptionPane.showInputDialog("Enter any 10 numbers:")); String num[]= new String [11]; for (int i=1; i<=size;i++){ num[i]=JOptionPane.showInputDialog("num["+i+"];"); ctr=ctr+num[i]+ " "; } JOptionPane.showMessageDialog(null, ctr); } } [/CODE] thats my code, what should happen in there is that, the numbers that i have inputted should be shown on an ascending and descending order. i still dont know how to use sort.array so i guess ill have to do it on another way.. please help me thank you

Member Avatar
Member Avatar
+0 forum 10

Hi. I was wondering if someone could help me out with a project. The assignment says to call a void function called InsertIntoArray passing the array, the entry the user entered and place the positive integer into the correct element of the array so that the array is always in ascending order. Change entries around inside the function so that all your entries are properly ordered. Cannot solve this problem by sorting the array after all the entries are entered! Here is what I have so far. The problem I keep having is that when I run it a message …

Member Avatar
Member Avatar
+0 forum 10

HI! could anyone help me out in editing the following code so that the list of number is displayed in ascending order. thanks. #include <iostream.h> void main() { int count; cout << "Enter a number: "; cin >> count; while (count > 0) { cout << count << endl; --count; } }

Member Avatar
Member Avatar
+0 forum 3

The End.