Printing on console list of arrays
Iam asked to invoke a function which returns array of strings.how shall i print it on console..if u can suggest me any classes ,it wud be helpful.
flounder wrote:
meacod wrote:
Unless they actually need to access it from another class. Then they need to know how to import and access, too :)Well g.pardhu lacks the ability to fully explain WTF they are trying to do.Very much agreed. Unfortunately they're not in as much of a minority here as I'd like, in that respect :(
Similar Messages
-
Need help with ouput of a list or array of numbers input from user
I'm only a few weeks into learning java, so this may seem simple to some, but...
I am trying to write a program that will receive numbers from a user,
and then list, add, average those numbers. I've got the program to
work except for listing the numbers that were input.
Can someone help guide me????
i've left the code I've tried in as comments.
Enter an integer value, the program exits if the input is 0:
20
Enter an integer value, the program exits if the input is 0:
40
Enter an integer value, the program exits if the input is 0:
60
Enter an integer value, the program exits if the input is 0:
80
Enter an integer value, the program exits if the input is 0:
0
Total numbers entered: 4
The array of numbers is: 0 0 0 0
The sum is 200
The average is 50
The maximum number is 0
The minimum is 0
Here is my code:
* Title: Reads integers and finds the total, average, maximum of the input values
* Description:
* Copyright: Copyright (c) 2002
* Company: Duke Court.
* @author Mary Davenport
* @version 1.0
public class part3page6
public static void main(String[] args)
int data = 0;
int sum = 0;
int countnum = -1;
int maximum = 0;
int minimum = 0;
int average = (countnum - 1);
do
System.out.println("Enter an integer value, " +
" the program exits if the input is 0: ");
data = MyInput.readInt();
sum += data;
countnum++;
} while (data != 0);
//in order to figure the max & the min it appears that the
//program will need to utilize arrays to store the individual numbers
//that are input from the user.
//create an array of the input data
int[] number = new int[countnum];
//creat a list of the input data
int []myList = {data};
//lists how many numbers entered
System.out.println("Total numbers entered: " + number.length);
//list array of numbers -- this is giving me [I@3179c3,
//instead of 20, 40, 60, 80 when I use "new int[countnum]"
// System.out.print("The array of numbers is: "
// + new int[countnum]);
//list array of numbers: this is giving me " 0 0 0 0 "
//instead of 20, 40, 60, 80 with the following for statement
// (number[i] + " ")
System.out.print("The array of numbers is: ");
for(int i=0; i<number.length; i++)
System.out.print(number[i] + " ");
//list mylist of numbers from input, 20, 40, 60, 80
//output is The list of numbers is: [I@3179c3
// System.out.print("The list of numbers is: " + myList);
System.out.println();
System.out.println("The sum is " + sum);
average = sum/countnum;
System.out.println("The average is " + average);
System.out.println("The maximum number is " + maximum);
System.out.println("The minimum is " + minimum);When you input the data you need to save it to the array. Currently you are not saving the value you are just adding it
ArrayList nums = new ArrayList();
do
System.out.println("Enter an integer value, " +
" the program exits if the input is 0: ");
data = MyInput.readInt();
nums.add(new Integer(data));
sum += data;
countnum++;
} while (data != 0); -
Printing iCal weekly list view
Experimenting with a trial version of Missing Sync to sync my Palm with iCal. Is it possible to delete the notes that appear under each event when I print the weekly list view? I print out 8 days and I want to keep it to one page. Eliminating the notes would help. Or is it possible to add the time frame to each event in the week view so you can more easily see the begin and end time for each event?
Is the Missing Sync program worth it or should I just use the sync program that came with iCal?pinkbeats wrote:
+1 to it's return.
Seems strange that it's been removed when, with the increased convergence of OS X and iOS, it's a view that available in the Calendar app in iOS.
Like others here, this was the most useful view for me and I'm disappointed it's not there, hope it comes back with the Yosemite .1 release.
Unfortunately it hasn't . -
When I try and print off a list of my contacts, it defaults to an envelope style, with all the info. I just want a list of names. How do I do that?
Thanks so much Martin. It took me awhile to figure out that in the print mode, there is an arrow that expands the print dialog box. I've been looking for the print dialog box for awhile, and now that I found it, I could make my list. Thank you SO much!! I can show my computer savvy husband that I learned something new today!!! I'm SO happy!!!
-
Is there a way to print an e-mail without also printing a long list of addresses?
I am a recipient of some newsletters whose authors include recipient e-mail addresses in the To and CC fields. Occasionally I want to forward the newsletter to friends who are not on-line. (Yes, there are still some around.) I do this by printing the newsletter and forwarding it via snail mail. I could reduce the number of pages if I could avoid printing the address list.
I have not found any discussion of this topic in Thunderbird help or Mozilla support.Unfortunately, there is no built-in way to easily modify the Subject/From/Date/To section of the print layout.
Thunderbird can be customized with style rules, but since you only want to omit the To on a case by case basis, that would not be a convenient approach. (Unless one of the rules could limit To to no more than one line. Maybe that would be a reasonable workaround?)
You could check for an add-on. -
Can I print out the list of Dictation commands?
I use dictation a lot but I can't memorise all the commands until I've learned them. The trouble is that to find out what they are, I have to go into system preferences, and from there to Accessibility, and from there a whole series of other steps before I get to the on-screen list of commands.
By which time I've probably forgotten what I was trying to do anyway.
Isn't there some way of printing out this list of commands?iTunes > Store > View my Account...
Click on Purchase History "See All".
Unfortunately I do not know of a way to view more than one "batch" of ten purchases at a time, and there is no way to print the list directly. Grab a screenshot and print each one is the only way I can think of. -
Duplex printing of invoice list in smartform
Hi,
I am new to smartforms and I have to handle duplex printing. I need information like how to give the page sequence for duplex printing.
I have 2 pages, page 1 prints the header list of the invoice. Page 2 prints the invoice list and has the main window, hence if the data in the 2nd page overflows then the invoice list will be printed on the 3rd page. In this scenario I have to get terms & conditions printed behind all the 3 pages.
I created page3 with terms & conditions. This is the way I gave:
PAGE1 - Print mode: D; Next page: Page3
PAGE3 - Print mode: ' '; Next page: Page1
PAGE2 - Print mode: D; Next page: Page3
I have a doubt like if the 3rd page is printed with invoice list then will the 3rd page contain the terms & conditions? Please correct me if I am doing wrong.
Thanks & Regards,
Kate.Hi
It depends on where you've placed those data, if they are in the bottom of the main, yes you're right: they'll be printed only in the last page.
If they're are in another window, they are printed in every page (where the window is defined).
Max -
Problem in Printing the ALV list
Hi,
I have one problem with printing the ALV list. While printing the ALV list(thro Print Icon on application Tool bar) ,Fist page of my print out contains some other inforamtion.
inforamtions included two tables
first table contains Sort Criteria, Ascdg, Descnd, Subtotal columns.
And second table contains Data statistics , number of
columns.
But from Second page onwards , my alv list printed correctly .
How can i avoid the First page inforamtion and
what is the Reason of coming like this?
Thanks,
Neptune.MI assume you are using function module Reuse_alv_grid_display or reuse_alv_list_display for ALV.
If this is the case, there is a parameter called IS_PRINT that you need to supply while calling the function module.
you can for exapmle declare
data:
printstruc type SLIS_PRINT_ALV.
printstruc-NO_PRINT_LISTINFOS = 'X'.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_PRINT = printstruc
There are many other flags in is_print structures that you can use to manipulate the printing.
Cheers! -
File Print on the list item doesn't print the whole content in IE8
Hi,
I have this issue happened on my customer side. Their IE version is 8.0.7600.16385.
By using this version of IE to do a file > print of a list item with long html content, the html content will get chop off. Refer to the screenshots.
Print Preview
List Item
HTML code in the "Content" column
<div class="ExternalClass1BFFAF9C72F744C7899695B11ADC69F3"><p>Printing Issue Simulation</p>
<p><img alt="XXX.jpg" src="XXX.jpg" style="margin: 5px; width: 647px; height: 1000px"/><br/><br/>2012-06-18 17:29:47 - Processor architecture is (9)<br/>2012-06-18 17:29:47 - Reading the following string value/name...<br/>2012-06-18 17:29:47 - Common Startup<br/>2012-06-18 17:29:47 - from the following registry location...<br/>2012-06-18 17:29:47 - SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders<br/>2012-06-18 17:29:47 - The value is... <br/>2012-06-18 17:29:47 - C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup<br/>2012-06-18 17:29:47 - Trying to remove the startup task if there is any.<br/>2012-06-18 17:29:47 - C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\SharePointServerPreparationToolStartup_0FF1CE14-0000-0000-0000-000000000000.cmd<br/>2012-06-18 17:29:47 - Error: Startup task doesn't exist. This is not a continuation after a restart.<br/>2012-06-18 17:29:47 - Analyzing the following command line argument:<br/>2012-06-18 17:29:47 - /unattended<br/>2012-06-18 17:29:47 - Unattended installation<br/>2012-06-18 17:29:47 - Analyzing the following command line argument:</p>
<p><img alt="XXX.jpg" src="XXX.jpg" style="margin: 5px; width: 647px; height: 1000px"/></p>
<p> </p>
<p></p></div>
If file > print is done in higher IE version, it can be printed out nicely.
Is there a way to fix this issue as customer side may not able to upgrade to the higher IE version? e.g. CSS
Thanks in advance.
jingzo (^_^)Hi,
According to your description, my understanding is that the print function of IE8 doesnot print the whole content of SharePoint list item.
For troubleshooting your issue, please turn off Protection Mode for the IE8.
You can refer to the thread:
https://social.technet.microsoft.com/Forums/en-US/b8ab8f65-9b27-4a90-9323-0ca5b7e4466e/print-preview-print-of-web-pages-doesnt-work-in-ie8?forum=w7itproperf
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Print Individual task Lists from Project 2010
Hi
I have a routine which prints individual task lists from a Project Plan using VBA. This routine is currently being piloted and they have advised that not all resources have a task list produced. when I step through the code the Resource numbers
appears in this order:
1,3,18,7,8,9,11,12,13,14,18,19,20,21,22,23,24,25
Task lists are produced for each of the above resources. However this misses resource numbers 2,4,5,6,10,15,16,17 and I have no idea why. I have supplied my code below. Any advice/guidance appreciated. You will note that the task
lists are exported to a pre-defined spreadsheet template.
Sub PrintResourceCharts()
Dim xlApp As Excel.Application
Dim xlRange As Excel.Range
Dim rName As String
Dim Tsk As Task
Dim Res As Resource
Dim Ass As Assignment
Dim s As Worksheet
Dim BookNam As String
Dim Row As Integer
Dim fName As String
'Call SetSummaryTask - DB: commented out - run summaryname manually as required.
Call Task_CF_To_Assignment_CF
'Remove Existing Task List files from directory before creating new ones
On Error GoTo Finish
Kill "D:\Task List Templates\Task Lists\*.*"
Finish:
'Save File Location
fName = "D:\Task List Templates\Task Lists\"
'Start Excel and Create a new Workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
'Export Resource and Task details
For Each Res In ActiveProject.Resources
If Res.Assignments.Count > 0 Then
Row = 5
xlApp.Workbooks.Open ("D:\Task List Templates\Task List Template.xlsm")
BookNam = xlApp.ActiveWorkbook.Name
Set s = xlApp.Workbooks(BookNam).Worksheets(1)
For Each Ass In Res.Assignments
Set xlRange = s.Range("A5")
If Ass.PercentWorkComplete < 100 Then
With xlRange
rName = Ass.ResourceName
s.Range("A" & Row).Value = Ass.ResourceName
s.Range("B" & Row).Value = Ass.TaskUniqueID
s.Range("D" & Row).Value = Ass.Text1
s.Range("E" & Row).Value = Ass.Start
s.Range("G" & Row).Value = Ass.Finish
End With
End If
Row = Row + 1
Set xlRange = xlRange.Offset(Row, 0) 'Point to next row
Next
xlApp.Visible = True
Application.DisplayAlerts = False
If rName = "" Then
GoTo Finished
End If
xlApp.ActiveWorkbook.SaveAs FileName:= _
"D:\Task List Templates\Task Lists\" & rName & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
rName = ""
xlApp.ActiveWorkbook.Close savechanges:=False
Application.DisplayAlerts = True
End If
Next
Finished:
xlApp.Application.Quit
Set xlApp = Nothing
MsgBox ("Individual Task Lists have now been produced....")
End SubTony,
You said you step through the code and it picks up resource 1. What happens when the loop gets to resource 2? Note: since resource 1 may have several assignments and stepping through them all could take some time, I sometimes use a stop statement in the
outer loop to make it a little easier to "catch" what I'm looking for. For example, you could put this right after the For Each Res...
If Res.ID = 2 then stop
Then step through and see what happens.
John -
I can see my printer and iPad on router but iPad cannot connect to printer. Printer is on list of air printer models accepted. Help!
You may have to visit the printer manufacturer's web site and look into their support pages to get a print driver for your Mac, and install it. Or see if you can see if a driver may already be in your Mac by checking settings, since there are many drivers already installed in Mac OS X.
Good luck & happy computing! -
When song list is printed from play list in Itunes for inserting into CD jewel case, the song list is compressed and is indecipherable. Did not have this problem prior to latest software change.How can I fix this ?
Can you play the song in iTunes?
If you can't the song file is probably corrupt and needs to be replaced. -
Printing the Pick List at operation level
Hi all,
Is it possible to Print the Pick List at operation level.
Components are assigned to each operations and release of production order takes place at operational level. Once operation is released then only relavent component assigned to that particular operation should come in pick list.
Thanks in advance for your time and efforts.
Regards,
Siva
Edited by: Siva Kumar M on May 19, 2008 3:40 PMHi ,
System will not select the Opertaion which has status CRTD by default.
For further selection please try with below settings. ,
Profile = std profile
Production Order Number,
Selection at Operation level
System status = CRTD and Actiavte Excl .check box.
Now system will display the pick list for released operation and it`s component only
Please check, Reward if it is useful.
Pradeep
Edited by: Pradeep Kumar on May 19, 2008 3:45 PM -
After installing optional Windows Update for Windows Server 2012 R2 (KB2995388) on a print server upgraded from Windows 2012 to Windows 2012 R2, the Print Management Console wouldn't display locally shared or remotely shared printers. Another print server
could see the printers on this server, but it couldn't see it's own. Removal of the patch resolved the issue.Hi,
à
Removal of the patch resolved the issue.
Thanks for sharing in the forum. Your time and efforts are highly appreciated.
On current situation, would you please let me confirm something more?
Please check if this update rollup package (KB2995388) install successfully.
Please run sfc /scannow command to scan all protected system files after installed this update.
If be possible, please re-install Print Server feature on the server after installed this update. Any find?
If any update, please feel free to let me know.
Hope this helps.
Best regards,
Justin Gu -
I want to print my contact list on my MacBook Pro
i want to print my contact list on my macbookpro
Open Contacts. Got to File in the menu bar and select Export as PDF...
The file will be saved to your desktop, with a name like Contact and..... You can double click this to open it and print it.
(This procedure is more reliable than using File / Print.)
Maybe you are looking for
-
Cisco or Linksys DSL router that will work with Windows XP Pro?
Any suggestions for a CISCO or LINKSYS DSL router to replace a Zyxel (Century Link) PK5001Z? System is Windows XP Pro, 20 wireless and wired devices connected (including 6 CISCO WVC210 IP cameras ). The Zyxel forwards as many ports as I want, but wil
-
Acrobat X fails to open/launch
I followed the suggested link to deactivate an Adobe product. It deactivated and relaunched but never prompted me to reenter the serial number portion of the steps. As mentioned in another reply to this suggestion, all products now do not give the op
-
2011 Camry Bluetooth Phonebook Transfer
I just got a new Camry and my iPhone 4 works with the hands free Bluetooth calling. It also works with the iPod USB connection as well and allows multitasking in case you want to run a navigation app in the foreground. The problem I am having is gett
-
Help needed with analytical function
I want to get the employee details of the highest and 2nd highest salaried employee in a particular department. But also the department should have more than 1 employee. I tried the query and it gave me proper results. But I'm wondering if there is s
-
OID - need to store certificates
Hi, For implementing the SSL requirements for the environment, We want to store Certificates in OID. There are certificates for Proxy server, OIM, etc. which we need to store. How can this be done ? Is this a good practice to do this way ? Thanks.