How to write message?

Hi,
I have a problem in writting message after downloading. When the records of Customer download successful, the message" Customer code 1111111 download OK' will showed.
With the coding I wrote, Just only one customer code showed in the download message, and the other customer code which were download successful could not been showed.
Question: I need to show all the successful downloaded customer code, How can I correct the folloing coding?
Please help, thank you.
Data:      anz_dl1(15)   type n,
              anz_dl2(15)   type n.
BEGIN OF HTEXT1,
        text1(30)         VALUE 'customer code',
        anzahl1(150),
        text3(20)         VALUE ' DOWNLOAD NG',
        END OF HTEXT1,
        BEGIN OF HTEXT2,
        text3(30)         VALUE 'customer code',
        anzahl2(150),
        text4(20)         VALUE ' DOWNLOAD OK',
        END OF HTEXT2.
CLEAR anz_dl1.
      CLEAR htext1-anzahl1.
WRITE T1-KUNNR TO anz_dl1.
      WRITE T-KUNNR TO anz_dl2.
WRITE anz_dl1 to htext1-anzahl1.
      CONDENSE htext1.
      WRITE anz_dl2 to htext2-anzahl2.
      CONDENSE htext2.
IF p_downl = 'X'.
             SKIP 2.
        WRITE: / htext1.
        SKIP 2.
        WRITE:/ htext2.

Hi ,
Thank you for your e-mail.
I write the coding as following and the following and the outlook like this:
Outlook
11 records writen in file C:\TEMP\CU_CC2080_28012008_134446.txt
Customer code: 300100000 DOWNLOAD NG
Customer code: 000000000000000 DOWNLOAD NG
Customer code:300100005 DOWNLOAD OK
Customer code: 300100089 DOWNLOAD OK
Customer code: 000000000000000 DOWNLOAD  OK
Customer code: 000000000000000 DOWNLOAD NG
My question is :
The customer code 000000000000000 do not exit, but it appear in the outlook for DOWNLOAD NG AND DOWNLOAD OK, how can I correct it?
The source code:
CLEAR anz_dl1.
  LOOP AT t1.
    WRITE t1-kunnr TO anz_dl1.
    WRITE anz_dl1 TO htext1-anzahl1.
    APPEND htext1 TO htext1_tab.
  ENDLOOP.
  SORT htext1_tab BY anzahl1.
  DELETE ADJACENT DUPLICATES FROM htext1_tab COMPARING anzahl1.
  CLEAR anz_dl2.
  LOOP AT t.
    WRITE t-kunnr TO anz_dl2.
    WRITE anz_dl2 TO htext2-anzahl2.
    APPEND htext2 TO htext2_tab.
  ENDLOOP.
  SORT htext2_tab BY anzahl2.
  DELETE ADJACENT DUPLICATES FROM htext2_tab COMPARING anzahl2.
  WRITE anz_dl1 TO htext1-anzahl1.
      APPEND htext1 TO htext1_tab.
      WRITE anz_dl2 TO htext2-anzahl2.
      APPEND htext2 TO htext2_tab.
LOOP AT htext1_tab INTO htext1.
          CONDENSE htext1.
          SKIP 2.
          WRITE: / htext1.
        ENDLOOP.
        LOOP AT htext2_tab INTO htext2.
          CONDENSE htext2.
          SKIP 2.
          WRITE:/ htext2.
        ENDLOOP.
Please help, thank you!

Similar Messages

  • How to write messages into system log(sm21) using c_write_syslog_entry

    Hi,
    May i know how to write my application messages into system log(sm21)
    using "c_write_syslog_entry". Any explanation regarding the Type. ID, Data
    will be useful with examples. Incase of any other FM's or C functions does
    the same Please let me know.
    Thanks
    Prasath

    Hello Prasanth
    I agree with Kareem that you should prefer the application log. If interface IF_RECA_MESSAGE_LIST is available on your SAP system this is the first choice for collecting messages AND storing them as application log.
    For an example you may have a look at my Wiki posting [Message Handling - Finding the Needle in the Haystack|https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
    Not shown in this example is the storage of the application log. However, if you look at method CF_RECA_MESSAGE_LIST=>CREATE you see that you can add the application log references here.
    Regards
      Uwe

  • How to write messages in Itaian

    Hi, I work with Italians a lot and woud like to be able to write an SMS in italian like I did with my old E50.
    I've been to writing languagebut it only offers french and dutch. Any ideas? Do I have to download something. I'd eventually like to change the whole phone language, but I'll worry about that later.

    Phones are sold with languages commonly used in the area where they're intended for sale. For example, phones intended specifically for the Belgian market have English, French and Dutch languages, while a phone intended for Western Europe as a whole will have those plus Spanish, Portuguese, Italian and German.
    Changing the language of your phone is not something you can do as an end-user. You need to take the phone to a Nokia Care Point and ask them to install an Italian language pack.
    Since the absence of Italian language in your phone is not a fault as such, installing it is not covered by the warranty. There may therefore be a small charge for this service. Also bear in mind that the language pack installed this way may not survive a reset or a firmware update, meaning that you may have to have it re-installed if you do either.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • How to write Error message for select options?

    Hi
    i have this select option statement
    SELECT-OPTIONS: s_fevor FOR afko-fevor.
    how to write error message for this?
    Regards
    Smitha

    Error messages are displayed for Select-options mostly on two conditions:
    1) You needs to check wether a value is entered or not its done by:
    a)
    Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.
       In this case error message is automatically throwed by system.
    b) You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    IF S_FEVOR-LOW IS INITIAL.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    2) You need to Validate the entered value:
    You can do this in Selection Screen events.
    Ex:
    AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
    SELECT FEVOR
                 FROM AFKO
                 INTO AFKO-FEVOR
                 UP TO 1 ROWS
    ENDSELECT.        
    IF SY-SUBRC NE 0.
    MESSAGE 'XXXXX' TYPE 'E'.
    ENDIF.
    Regards,
    Gurpreet

  • How to write the expression when create the calculated column?

    Dear,
           I want to create some calculated column in my attribute view, but I don't know how to write the code in the expression, is there any introduction about this part, how to use those function and how about the grammar in this expression code ?  or is there any example about this calculated column?
       Thanks for your sincerely answer.

    Hi Zongjie,
    you can find some information about the creation of calculated columns in the HANA Modeling Guide (http://help.sap.com/hana/SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en.pdf).
    Within chapter 6.2.1 (Create Analytic Views) you can see under point 7 some basics and also a simple example. The same is also valid for Calculation Views.
    Chapter 8.9 (Using Functions in Expressions) describes the different available functions.
    You also can use the integrated search in the HANA Studio by clicking the "?" button in the button left corner. Then you get some links in the side panel with related information.
    In general you can write your expression manually or you can just drag and drop the functions, elements, operators into the editor window. For example if you drag and drop the "if" function into the editor window you get "if(intarg,arg2,arg3)" inserted. The arguments can be replaced manually or also by drag and drop.
    It is also worse to use the "Validate Syntax" button on top of the editor window. It gives you directly a feedback if your expression syntax is correct. If not you get some helpful information about the problem (ok, sometimes it is a little bit confusing because of the cryptic error message format ).
    Best Regards,
    Florian

  • How to write log information into SM37 batch job log

    Hi,
    I have a report running in batch mode, and I would like to log the start time and end time for some part of the code (different Function modules). I need to write this log information into the batch job log. Therefore I can check the time frame of my FMs.
    After search the SDN, I can only get some information on how to write log into the application log displayed in SLG1, but that's not I want. I want to write batch log information, and check it in SM37.
    If you have some solution or code to share, please. Thanks a lot.
    Best Regards,
    Ben

    Hi Nitin
    Thanks for the reply. Could you explain it with some code ?
    I tried to use the write statement , but it did not wrok. I could not see the result in SM37.
    write : "start of the FM1 processing".
    FM1 code
    write : "end of the FM1 processing".
    but those two statement did not show in SM37..
    1) how to use  a information message  ?
    2) how to use NEW PAGE PRINT ON and PRINT OFF command. ?
    I would appreciate if you can write some code ,that I can use directly.
    Thanks a lot.
    Best Regards,
    Ben

  • Write message to Job log with message class and message number

    hi folk,
    When running a background job I'm able to write a message to the job log using the statement - Message "some text..." type 'I'.
    In the Job log I can see the message "some text.." with a "default" message class and message number (but in my report i don't specify any message ID) so I have no idea it comes from.
    Then I try to send a message where I specify the message class/number etc...using message id 'Z1' number 000 with "some text..." In the job log I now can see the "right" message class "Z1" and the number 000, but the message is empty?
    Please advice how to write a message with the message class and message number.
    Best regards
    LinhNg

    Hi Linh,
    How did you provide the text "Some message"? Did you hard code it or used a text element?
    Regards,
    Immanuel.

  • How to suppress message when BW BEx query is run?

    hi,
    The message can be suppressed from RSRT, give the name of the query and in the messages tab suppress the message you want to suppress.
    However in your case it seems that the message is coming as you are reporting on DSO and the DSO SID generation tick box might not have been ticked. The query is trying to generate the SID for the data on the fly and as you have already restricted with some attibute of MD this message is coming.
    To resolve this issue you can tick the generate SID option in the DSO and then report on it.
    regards,
    Arvind.

    Yes. I have checked it. The message is not there.
    In SE91, I have checked the class DBMAN and message number is 345.
    there is one more function module BAL_DSP_LOG_DISPLAY which retrieves messages from memory. Can the message be suppressed here?
    [http://help.sap.com/saphelp_nw04/helpdata/en/bb/6811f980ae11d3966f00a0c930660b/frameset.htm]
    Enhancement options
    [http://help.sap.com/saphelp_nw70/helpdata/EN/a0/47e94086087e7fe10000000a1550b0/frameset.htm]
    I am trying figure out from the above links, but I am not going into right direction like how should i start and how to write.

  • How to write heading in bold on a simple list?

    On a simple list, I want to write a heading in bold. How to write one in bold?
    Thanks.

    Hello,
    Format intensified on.
    Write: / l_header_text.
    Format intensified off.
    Message was edited by: Cyrill Smirnov

  • How to write oracle output in XML

    can any one please let me know how to write or covert procedure or function output in XML?

    845470 wrote:
    can any one please let me know how to write or covert procedure or function output in XML?What is that asking?
    Are you wanting to take output from a procedure/function that is in XML format and then convert it to something else?
    Are you wanting to get the procedure/function to produce output in XML format?
    Are you wanting to take an existing procedure/function and convert it so the code is stored in some XML structure for some purpose?
    How is anybody supposed to know what you're talking about if you don't explain it?
    {message:id=9360002}

  • How to write the folder path in standard webi report - Most Accessed Documents

    How to write the folder path in standard webi report - Most Accessed Documents
    All
       -> Public Folders
                      -> Auditor
                      -> ABCD
    I want to give path of folder 'ABCD' and all the reports/ subfolders under it?
    Prompt - 'Enter the Folder Path(Add % at the end to include Sub Folders)' ?
    Give me exact path syntax

    Hi Daniel,
    But when I give my URL as
    http://serverA:80/irj/portal??NavigationTarget=ROLES://portal_content/crm-practice/14-Feb/Test_Page
    I am able to access the iview but the thing is I am getting TLN,Toolarea,Masthead,etc.
    I will tell my requirement,
    ServerA (EP 7.0) has some iviews,pages...
    I need to access these iviews from serverB(EP 6.0)....
    In ServerB only the iviews has to be displayed in the content area but not TLN,Toolarea,etc.
    Kindly help me in this regard.
    Thanks and regards,
    Purushothaman.
    Message was edited by: Purushothaman Vyasarao

  • How to write error log while creating invoice and avoid implicite commit

    Hi,
    I've have written code in exit RV60AFZZ in which I check for some possible errors while invoicing via VF01/VF04. If conditions are met then we create error message and display it to the user. As result we had a lot of missing SD invoices in FI when we did batch/mass invoicing. I've opened OSS note and SAP support team wrote that using statement MESSAGE is forbidden in UE. It can lead to implicite commits.
    Do you have some example how to write error log for invoincing in VF01/VF04 transactions?
    Thanks

    @ sri nath. Please read post before answering. I wouldn't be posting trivial questions. As I wrote before it doesn't work.  Also SAP support would not answer to the question in my OSS.
    In VOFM, SAP is using routine  VBFS_HINZUFUEGEN_ALLG to write to error log.
    Mine is something like this in ue:
          PERFORM ZVBFS_HINZUFUEGEN_ALLG
                     USING VBAP-VBELN VBAP-POSNR  'ZSD' 'E '600'
                           SPACE SPACE SPACE SPACE.
    (we have custom message class)
    As result  XVBFS and VBSK are filled with error, but posting is also done.  Error log is filled but invoice is created and posted in FI.
    That is not OK.
    thanks

  • How to write this assignment in oom way(long)

    i try to write a new class, but i am not very sure if there is only one new class, I shall write a Movie class or a Ticket class?
    this is my Movie class, if I also want to write a new Ticket class. and still i don't know how to write
    because the Ticket class uses some of the attributes of the Movie class such as start time, Movie.name, as in this situation the relation
    between Ticket and Movie is still aggregation, or become a generalization?
    and how to represent that a Movie can have many Tickets? I shall write a buy-ticket method inside the Ticket class or Movie class.
    (are there any thing not right with this movie class? thanks)
    ============================
    class Movie
         String name;
         String startTime;
         String [] coupleChair=new String[11];//start from 1 to 10
         String [] singleChair=new String[11];//start from 1 to 10     
         public Movie(String str1st)
              this.name=str1st;
         public Movie(String str1st, String str2nd)
              this.name=str1st;
              this.startTime=str2nd;
         public String buyA_Single_Ticket()
              int i=1;
              do
                   if(this.singleChair!="sold")
                        this.singleChair[i]="sold";
                        return "You seat is Single Seat No."+i+"\n Enjoy the movie :)";
                   else i++;
              while(i<=10);//when i==11 jump out
              return "Sorry, all Single seats have been sold Out";
         public String buyA_Couple_Ticket()
              int i=1;
              do
                   if(this.coupleChair[i]!="sold")
                        this.coupleChair[i]="sold";
                        return "You seat is Couple Seat No."+i+"\n Enjoy the time ;)";
                   else i++;
              while(i<=10);//when i==11 jump out
              return "Sorry, all Couple seats have been sold Out";
    }//end class
    ============================
    this is the question
    A small ABC cinema has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a Java application to assign seats on each movie show on the day (capacity: 20 seats for 1 movie).
    Your program should display the following alternatives: ��Please type 1 for couple seat section�� and ��Please type 2 for normal seat section��. If the user types 1, your program should assign one seat in the couple seat section (seats 1 �C 10). If the person types 2, your program should assign a seat in the normal seat (seats 11 �C 20). Your program should also prompt for the movie time and movie name.
    Your program should then display:
    I.     The person��s seat number
    II.     Whether it is a couple seat or normal seat of the cinema
    III.     Time, date, movie name
    Your program should never assign a seat that has already been assigned. When the normal seat section is full, your program should ask the person if it is acceptable to be placed in the couple seat section (and vice versa). If yes, make the appropriate seat assignment. If no, print the message ��Next show is in 3 hours time.��
    (it is just a small test on my OOM learning, I know it is not necessary to make it so complex.)

    Break down your problem into discrete chunks. The more you practice this, the more your initial thoughts will resemble the eventual objects that you will create.
    Let's take address a few of your issues:
    What has the start time? Is it the ticket or the movie? (Hint: Would someone ever print you out a ticket with a different start time than the movie's?)
    If ticket and movie share some attributes, then you can either use inheritance or composition/delegation. In this instance, what makes more sense to you? Is a ticket a movie or vice versa? Or is a ticket simply related to a movie?
    If a given object can contain several instances of another object, you will want to use either an array or a collection, probably List in this instance.
    Why is there no Theater object? A movie may play at multiple theaters. Each theater has a capacity (in terms of total seats and number already booked). This does not really have anything to do with the movie. It is the Theater that you are booking. It may also have which movies are showing at which time.
    Your notion of 'couple' booking seems strange. Why not have a concept like 'consecutive seats required'? That way, your design is more flexible and you can still accomodate couples.That should get you started. Best of luck.
    - Saish

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • Really need help on how to write this program some 1 plz help me out here.

    i am new to java and i confused on how to be writing this program.
    i have completed the Part 1 but i am stuck on Part 2 & 3 so it would would be really great if any 1 could help me out on how to write the program.
    Part I
    An algorithm describes how a problem is solved in terms of the actions to be executed, and it specifies the order in which the actions should be executed. An algorithm must be detailed enough so that you can "walk" through the algorithm with test data. This means the algorithm must include all the necessary calculations.
    Here is an algorithm that calculates the cost of a rectangular window. The
    total cost of a window is based on two prices; the cost of the glass plus the cost of the metal frame around the glass. The glass is 50 cents per
    square inch (area) and the metal frame is 75 cents per inch (perimeter).
    The length and width of the window will be entered by the user. The
    output of the program should be the length and width (entered by the user)
    and the total cost of the window.
    FORMULAS:
    area = length times width perimeter = 2 times (length plus width)
    Here is the corresponding algorithm:
    read in the length of the window in inches
    read in the width of the window in inches
    compute the area
    compute the cost of the glass (area times 50 cents)
    compute the perimeter
    compute the cost of the frame (perimeter times 75 cents)
    compute the total cost of the window (cost of glass plus cost of frame)
    display the length, width and total cost
    The next step would be to "desk check" the algorithm. First you would need to make up the "test data". For this algorithm, the test data would involve making up a length and a width, and then calculating the cost of the window based on those values. The results are computing by hand or using a calculator. The results of your test data are always calculated before translating your algorithm into a programming language. Here is an example of the test data for the problem given:
    length = 10
    width = 20
    area = 200, glass cost= 100.00 (area times 50 cents)
    perimeter = 60, frame cost = 45.00 (perimeter times 75 cents)
    total cost =145.00
    Once the test data is chosen, you should "walk" through the algorithm using the test data to see if the algorithm produces the same answers that you obtained from your calculations.
    If the results are the same, then you would begin translating your algorithm into a programming language. If the results are not the same, then you would attempt to find out what part of the algorithm is incorrect and correct it. It is also
    necessary to re-check your hand calculations.
    Each time you revise your algorithm, you should walk through it with your test data again. You keep revising your algorithm until it produces the same answers as your test data.
    ?Now write and submit a Java program that will calculate the cost of a rectangular window according to the algorithm explained. Be sure to prompt for input and label your output.?
    Part II
    Write, compile and execute a Java program that displays the following prompts:
    Enter an integer.
    Enter a second integer
    Enter a third integer.
    Enter a fourth integer.
    After each prompt is displayed, your program should use the nextint method of the Scanner class to accept a number from the keyboard for the displayed
    prompt. After the fourth integer has been entered, your program should calculate and display the average of the four integers and the value of the first integer entered raised to the power of the second integer entered. The average and result of raising to a power should be included in an appropriate messages
    (labels).
    Sample Test Data:
    Set 1: 100 100 100 100
    Set 2: 100 0 100 0
    Be sure to write an algorithm first before attempting to write the Java code. Walk through your algorithm with test data to be sure it works as anticipated.
    Part III
    Repeat Part lI but only calculate the average, not the power. This time, make sure to use the same variable name, number, for each of the four numbers input. Also use the variable sum for the sum of the numbers. (Hint: To do this, you may use the statement sum = sum + number after each number is read.)
    For Part 1 this is what i got
    import java.util.Scanner;
    public class Window
         public static void main(String[] args)
              double length, width, glass_cost, perimeter, frame_cost, area, total;
              Scanner keyboard = new Scanner (System.in);
              System.out.println("Enter the length of the window in inches");
              length = keyboard.nextInt();
              System.out.println("Enter the width of the window in inches");
              width = keyboard.nextInt();
              area = length * width;
              glass_cost = area * .5;
              perimeter = 2 * (length + width);
              frame_cost = perimeter * .75;
              total = glass_cost + frame_cost;
                   System.out.println("The Length of the window is " + length + "inches");
                   System.out.println("The Width of the window is " + length + "inches");
                   System.out.println("The total cost of the window is $ " + total);
         Enter the length of the window in inches
         5
         Enter the width of the window in inches
         8
         The Length of the window is 5.0inches
         The Width of the window is 5.0inches
         The total cost of the window is $ 39.5
    Press any key to continue . . .
    Edited by: Adhi on Feb 24, 2008 10:33 AM

    Adhi wrote:
    i am new to java and i confused on how to be writing this program.
    i have completed the Part 1 but i am stuck on Part 2 & 3 so it would would be really great if any 1 could help me out on how to write the program.Looks like homework to me.
    What have you written so far? Post it.
    Part I
    An algorithm describes how a problem is solved in terms of the actions to be executed, and it specifies the order in which the actions should be executed. An algorithm must be detailed enough so that you can "walk" through the algorithm with test data. This means the algorithm must include all the necessary calculations.
    Here is an algorithm that calculates the cost of a rectangular window. The
    total cost of a window is based on two prices; the cost of the glass plus the cost of the metal frame around the glass. The glass is 50 cents per
    square inch (area) and the metal frame is 75 cents per inch (perimeter).
    The length and width of the window will be entered by the user. The
    output of the program should be the length and width (entered by the user)
    and the total cost of the window.
    FORMULAS:
    area = length times width perimeter = 2 times (length plus width)
    Here is the corresponding algorithm:
    read in the length of the window in inches
    read in the width of the window in inches
    compute the area
    compute the cost of the glass (area times 50 cents)
    compute the perimeter
    compute the cost of the frame (perimeter times 75 cents)
    compute the total cost of the window (cost of glass plus cost of frame)
    display the length, width and total cost
    The next step would be to "desk check" the algorithm. First you would need to make up the "test data". For this algorithm, the test data would involve making up a length and a width, and then calculating the cost of the window based on those values. The results are computing by hand or using a calculator. The results of your test data are always calculated before translating your algorithm into a programming language. Here is an example of the test data for the problem given:
    length = 10
    width = 20
    area = 200, glass cost= 100.00 (area times 50 cents)
    perimeter = 60, frame cost = 45.00 (perimeter times 75 cents)
    total cost =145.00
    Once the test data is chosen, you should "walk" through the algorithm using the test data to see if the algorithm produces the same answers that you obtained from your calculations.
    If the results are the same, then you would begin translating your algorithm into a programming language. If the results are not the same, then you would attempt to find out what part of the algorithm is incorrect and correct it. It is also
    necessary to re-check your hand calculations.
    Each time you revise your algorithm, you should walk through it with your test data again. You keep revising your algorithm until it produces the same answers as your test data.
    &#147;Now write and submit a Java program that will calculate the cost of a rectangular window according to the algorithm explained. Be sure to prompt for input and label your output.&#148;
    Part II
    Write, compile and execute a Java program that displays the following prompts:
    Enter an integer.
    Enter a second integer
    Enter a third integer.
    Enter a fourth integer.
    After each prompt is displayed, your program should use the nextint method of the Scanner class to accept a number from the keyboard for the displayed
    prompt. After the fourth integer has been entered, your program should calculate and display the average of the four integers and the value of the first integer entered raised to the power of the second integer entered. The average and result of raising to a power should be included in an appropriate messages
    (labels).
    Sample Test Data:
    Set 1: 100 100 100 100
    Set 2: 100 0 100 0
    Be sure to write an algorithm first before attempting to write the Java code. Walk through your algorithm with test data to be sure it works as anticipated.So this is where you actually have to do something. My guess is that you've done nothing so far.
    Part III
    Repeat Part lI but only calculate the average, not the power. This time, make sure to use the same variable name, number, for each of the four numbers input. Also use the variable sum for the sum of the numbers. (Hint: To do this, you may use the statement sum = sum + number after each number is read.)Man, this specification writes itself. Sit down and start coding.
    One bit of advice: Nobody here takes kindly to lazy, stupid students who are just trying to con somebody into doing their homework for them. If that's you, better have your asbestos underpants on.
    %

Maybe you are looking for