Em Andamento

week 4 homework

The assignment for the week should be looked at from the perspective of enhancing last week’s assignment using the knowledge acquired this week. This would be achieved by doing the following. 1) Instead of holding the items in Inv as item0, item2, item3 up to item9, you should use array items[MaxItems]. MaxItems should be a static (final) integer initialized to the value of 10, or any value to accommodate the maximum number of items that you want to process. 2) Your program should thus be modified to use array. 3) You should create an instance method for Inv that sorts all the items in order of itemName. The method should be named sortByName(). The instruction for implementing this method is given below. 4) Modify your Invoice class to invoke the sortByName method before invoking the print method. A sort routine is shown in the text in Figure 8-20: The sortStrings() method. This sort routine should be modified as shown below, to accommodate an array of items rather than array of strings. (I threw in some additional curly braces to delineate the blocks. The version of the code in the book might be more difficult to follow.) public static void sortStrings(String[] array, int len) //note that item array is passed { int a,b; String temp; //Your temp would hold item object int highSubscript = len - 1; for(a = 0; a < highSubscript; ++a) { for(b = 0; b < highSubscript; ++b) { if(array[b].compareTo(array[b + 1]) > 0) //You would modify to something like: if(array[b].getItemName().compareTo { temp = array[b]; array[b] = array[b + 1]; array[b + 1] = temp; } } } } The lines that need changes are commented as shown above. Please, do the assignment in steps, so that you can get partial points, in the event that you cannot complete the whole assignment. As usual, ask as much questions as possible, to avoid getting stuck on minor issues

## Deliverables

Working program under Jgrasp ver 1.5.0 in Windows 2000

## Platform

I have attached the zip from last week's assignment. This assignment needs to be changed as decscribed above.

Habilidades: Engenharia, Java, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: ver 5, sort array, print hold, len, java invoice, php text array, create java object, windows homework, code jgrasp, string integer, figure print, jgrasp, array homework, invoke process, print routine, event method, print invoice program, string array, use print invoice, windows invoice program, php homework, public figure, homework questions java, homework java questions, java homework questions

Acerca do Empregador:
( 118 comentários ) United States

ID do Projeto: #2988265

Premiar a:


See private message.

$21.25 USD em 5 dias
(41 Avaliações)

5 freelancers estão ofertando em média $17 para este trabalho


See private message.

$8.5 USD in 5 dias
(62 Comentários)

See private message.

$12.75 USD in 5 dias
(37 Comentários)

See private message.

$25.5 USD in 5 dias
(13 Comentários)

See private message.

$17 USD in 5 dias
(5 Comentários)