Please help : How to print a matrix from the console...
Hi..
Please help:
How to print a matrix on the console , but i want to take all the input from the console.. like...
if the matrix is of size...
mxn
where
m : row
n : column
and the all the elements of the matrix from the console it self... .
Please help...
Thanks...
I am able to print the elements of the array but i am not able to assign those values to the array ....
How to do that...
I just did a little change in my code...
import java.util.Scanner;
public class CreatingAMatrix {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Enter the number of rows: ");
Scanner scanner1 = new Scanner(System.in);
int m = scanner1.nextInt();
System.out.print("Enter the number of coulmns:");
Scanner scanner2 = new Scanner(System.in);
int n = scanner2.nextInt();
System.out.println("The size of the matrix is : " +m+" x "+n );
int[][] a = new int[100][100];
for(int i=0;i<=m;i++)
for(int j =0; j <= n; j++)
Scanner scanner3 = new Scanner(System.in);
int o = scanner3.nextInt();
System.out.println();
for(int i=0;i<=m;i++)
for(int j =0; j <= n; j++)
System.out.print(a[i][j] + "\t");
System.out.println();
}I am getting an output as this
output:
Enter the number of rows: 2
Enter the number of coulmns:1
The size of the matrix is : 2 x 1
1
2
1
2
3
5
0 0
0 0
0 0
how should i assig those input values to my array..
Please help
Similar Messages
-
my ipad2 is asking old id password, when i go to forget password link for that id then I am not getting any mail to reset the same. Please help how can i remove or change the old id.
You cannot remove or change the old ID. This is Find My iPhone Activation Lock. You need to recover the credentials for the Apple ID originally used to activate the iPad.
Check your spam and junk folders. -
Please help-how can I find accents on the keyboard when typing in French?
Please help.How can I find accents on the keyboard when typing in french?Thanks
You can also open the Keyboard Viewer & hold Option key & Shift+Option to see...
Option key...
Shift+Option or alt key... -
How to print a receipt from the iTunes store, I did not receive an email.
How can I print a receipt from the iTunes store when I did not receive an email.
The following may help: iTunes Store: See your purchase history and web order numbers
-
Please help - how do I import music from my ipod into a new itunes library?
Hello
I would very much appreciate it if someone could tell me how to get the music from my old ipod mini into the new itunes library on my new laptop.
The mini was previously sync'd with my old PC which died so my files are only present on the ipod. Upon loading itunes, the software is only letting my sync the ipod providing I wipe it (obviously not desirable...)
Thanks for any support, AndyConnect your iPod to your computer. When you get the message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" as you already know will irretrievably remove all the songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it. Also when using most of the utilities listed below your iPod needs to be enabled for disc use, changing to manual update will do this by default. Check the "manually manage music and videos" box in Summary then press the Apply button: Managing content manually on iPod
Once you are safely connected there are a few things you can do to restore your iTunes from the iPod. If you have any iTunes Music Store purchases the transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. You'll find details in this article: Copying iTunes Store purchases from your iPod to a computer
The transfer of content from other sources such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. Have a look at the web pages and documentation, this is just a small selection of what's available, they are generally quite straightforward. You can read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
TuneJack Windows Only
iPod2PC Windows Only
iGadget Windows Only
iDump Windows Only
SharePod Windows Only
iRepo Mac and Windows
iPodRip Mac & Windows
YamiPod Mac and Windows
Music Rescue Mac & Windows
iPodCopy Mac and Windows
There is also a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows or a Mac. The procedure is a bit involved and won't recover playlists but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod
Whichever of these retrieval methods you choose, keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync. I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay. -
Please help how to get return array from rpg program on java code?
Hi
I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
please suggest me regarding this issues I amn't so much aware on java & AS400.
try
ProgramParameter[] parmList = new ProgramParameter[2];
AS400Text p1 = new AS400Text(10);
AS400Text p2 = new AS400Text(30);
try
parmList[0] = new ProgramParameter(10);
parmList[1] = new ProgramParameter(30);
parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
parmList[0].setInputData(p1.toBytes("Pune"));
parmList[1].setInputData(p2.toBytes(" "));
catch(Exception ex)
ProgramCall pgm = new ProgramCall(o);
pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
if (pgm.run())
byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
parmList[1].getOutputDataLength();
//String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
else
AS400Message[] messageList = pgm.getMessageList();
for (int msg = 0; msg < messageList.length; msg++) {
catch(Exception ex)
AS400Message[] messageList = null;
finally
o.disconnectAllServices();
Reply With QuoteTry this :
try
ProgramParameter[] parmList = new ProgramParameter[2];
AS400Text p1 = new AS400Text(10);
AS400Text p2 = new AS400Text(30);
AS400Array arrP2 = new AS400Array(p2, 4);
try
parmList[0] = new ProgramParameter(10);
parmList[1] = new ProgramParameter(30);
parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
parmList[0].setInputData(p1.toBytes("Pune"));
parmList[1].setInputData(arrP2.toBytes({"","","",""}));
catch(Exception ex)
ProgramCall pgm = new ProgramCall(o);
pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
if (pgm.run())
Object[] objArr = (Object [])arrP2.toObject( parmList[1].getOutputData() );
for(int i =0; i<objArr.length;i++){
System.out.println( " SKU " + i +" : " + objArr.toString());
else
AS400Message[] messageList = pgm.getMessageList();
for (int msg = 0; msg < messageList.length; msg++) {
catch(Exception ex)
AS400Message[] messageList = null;
finally
o.disconnectAllServices(); -
Please help- how do I transfer songs from my brother's Itunes onto my Ipod?
I would like to transfer songs and movies from my brother's Itunes into my Ipod (both are 7.0 version). How in the world do I do this? I have tried to sync individual songs from his Itunes onto my Ipod through the right click sync on the device menu, but it just leads me to a confusing summary screen about my Ipod. I don't want to move all of his songs/movies onto mine, just a few.
Thanks in advance!
hp laptop Windows XPOn your brothers PC, COnnect the ipod.
On the ipod summery page hit the "Music" tab and check "Manually manage songs and video" then hit the "Apply" button in the lower righthand corner
Now you can drag items in itunes like songs and video from itunes to the ipods name listed in itunes, which will add the item to your ipod.
Keep in mind tho...
If he has any purchased content you add to your ipod, you will need his ID if you plan on adding it and using it on your itunes when you go home -
Please help how to pass a JavaBean from servlet to jsp?
Hi there,
I have got a dispatch servlet and I want the dispatch servlet to get the data and store it in a JavaBean before dispatching to the appropriate JSP page. However, I don't know how to pass the javabean to the JSP when the servlet forward the request to the JSP. Is ServletContext.setAttribute() the only way to pass the javabean to the JSP page?
Thank you very much!
EdmundYou can use HttpServletRequest.setAttribute(String name, Object javabean) to set the javabean into the HTTP request that you are forwarding to the JSP.
In the JSP, you can access the Javabean using request.getAttribute(String name) and cast it to the right class. -
Does anyone know how to print an email from the new iPad before you send it?
I cannot print emails before sending them. The little print icon to print is not there. I even saved an email as a draft, and that did not work either. Is it even possible to print an email before you send it, or do you have to wait until it shows up as a "sent" email?
Im seeing the same thing.
You can take a screenshot or copy/paste the email into Notes and then print from there.
If you want to see the feature added or leave any type of feedback for the iPad or anything Apple related, you can do it here -> Apple - Feedback -
How do I restart X from the console or from bash script?
I have searched with google, but can't find any answers not involving gdm or xdm. I need this because I'm writing a simple script that compiles and installs dwm and then restarts x.
Thanks.Ashren wrote:
lilsirecho, no it does nothing.
buttons, sudo kill 'pidof X' && startx did work with xdm enabled (I still had to login again, though). The reason I don't use respawn is that I don't like display managers. Is there any way to circumvent them and still have the respawn feature? I want to restart dwm without typing in anything, besides the name of my script.
Thanks..
Absolutely.
Relevant parts of /etc/inittab:
id:5:initdefault:
x:5:respawn:/bin/su buttons -l -c "/bin/bash --login -c startx >/dev/null 2>/home/buttons/.xsession-errors"
"buttons" is of course my login name, and I prefer to have my errors go to a logfile in my home directory, which many display managers do by default. Or at least GDM. -
How to delete a column from the table control in module pool?
Hi,
can any one please tell How to delete a column from the table control in module pool?
thanks in advance
warm regards
HareeshKumar Nhi hareesh,
I think it is better to hide it.
How to hide: You can check this link
Dynamic Hide column in table control -
Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.
There are a number of OS X apps, many free, that will save your messages, allowing to view and print them.
http://www.softwarebbs.com/wiki/How_to_transfer_SMS_from_iPhone_to_Mac,_backup_i Phone_SMS_message_on_Mac
Google, for other options
Your "other" of 6 GB may include corrupted data or file sytem errors. If after removing the messages there is still >2GB, you will need to restore the phone in iTunes, first using a backup (made after deleting the messages) and if needed as a new iPhone.
iTunes: Restoring iOS software -
I bought a used iphone from a friend and I am not able to use it in Ethiopia. It is carrier blocked. Can you please help how could I unlock my iphone 4?.
Unlikely as you do not meet there requirements for unlocking.
Have your friend the provided the phone contact them. Based on your statements I am concluding he was or still is an AT&T customer, that is one of the requirements of getting the device unlocked. -
How can I stop and remove my credit card from my iPad ,my children keep buying games and I want to stop it......please help me to remove any payment from now on.
iOS: Understanding Restrictions
http://support.apple.com/kb/HT4213 -
Please help if you can: I accidentally deleted the IPOD app for my IPAD 3. I need it to enable HOME SHARING. How can I restore or reinstall it? It is not an app I bought, it came on the IPAD from Apple
See These Support Articles for Home Sharing
Understanding > http://support.apple.com/kb/HT3819
How to > http://support.apple.com/kb/HT2688
Troubleshooting > http://support.apple.com/kb/TS2972
Maybe you are looking for
-
Check for empty table row before adding date
On the form below, when I click the green + button (far right), a new table row is created with today's date. the user can then enter more text to the right of the date. Problem is when the form is saved and reopened, the text the user enters is dele
-
What's the right way to organize podcasts?
I have a question about the best way to keep podcasts. What I do is download podcasts from a few sources. I put them into a playlist (so that they go one after the other and don't require me to press buttons when one ends, which is what happens if I
-
Ever since I switched to Leopard I have been having trouble with Epson Utilities. I have two Epson printers, R200 and an R1800. When I want to print on the R1800 and go into Epson Utilities to check ink levels Utilities crashes. However it works fine
-
Problem in Connecting to PC Suite
Phone - Nokia 6275 CDMA Cable - Nokia CA-53 PC Suite - 6.83 PC OS - Win XP SP2 While trying to connect my phone to PC Suite through data cable, I get a USB device installation error message saying: "Service or service name already exists. USB device
-
Setting Page Items from SQL Query
Hi, </br></br> I am using "SQL Query (PL/SQL function body returning SQL query)" for a report. In the body of the sql query, after calling a function, I have the following statement: </br></br> APEX_UTIL.SET_SESSION_STATE( p_name => 'P13_MESSAGE', p_