1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OleMash [197]
3 years ago
14

Output all combinations of character variables a, b, and c. If a = 'x', b = 'y', and c = 'z', then the output is: xyz xzy yxz yz

x zxy zyx Your code will be tested in three different programs, with a, b, c assigned with 'x', 'y', 'z', then with '#', '$', '%', then with '1', '2', '3'.
Engineering
1 answer:
gladu [14]3 years ago
7 0

Answer & Explanation:

//written in java

public class Main {

   public static void main(String[] args) {

       //declare a char variable for a, b, c

       char a;

       char b;

       char c;

       //assign a b and c

       //a b and c can be replaced for with  

       // '#', '$', '%', then with '1', '2', '3'

       // for further testing

       a = 'x';

       b = 'y';

       c = 'z';

       //output for all possible combination for a, b, c.

       System.out.println("" + a + b + c + " " + a + c + b + " " + b + a + c +

               " " + b + c + a + " " + c + a + b + " " + c + b + a);

   }

}

You might be interested in
with a digital system, if you have measured incorrectly and use too low of a kvp for adequate penetration, what do you need to d
Lubov Fominskaja [6]

The x-ray beam's penetrating power is regulated by kVp (beam quality). Every time an exposure is conducted, the x-rays need to be powerful (enough) to sufficiently penetrate through the target area.

<h3>How does kVp impact the exposure to digital receptors?</h3>

The radiation's penetration power and exposure to the image receptor both increase as the kVp value is raised.

<h3>Exposure to the image receptor is enhanced with an increase in kVp, right?</h3>

Due to an increase in photon quantity and penetrability, exposure at the image receptor rises by a factor of five of the change in kVp, doubling the intensity at the detector with a 15% change in kVp.

To know more about kVp visit:-

brainly.com/question/17095191

#SPJ4

5 0
1 year ago
In your first job with a large U.S based steel company, you have been assigned to a team tasked with developing a new low carbon
nignag [31]

Answer:

Option A

Explanation:

3 0
3 years ago
Read 2 more answers
A sinusoidal wave of frequency 420 Hz has a speed of 310 m/s. (a) How far apart are two points that differ in phase by π/8 rad?
Olin [163]

Answer:

a) Two points that differ in phase by π/8 rad are 0.0461 m apart.

b) The phase difference between two displacements at a certain point at times 1.6 ms apart is 4π/3.

Explanation:

f = 420 Hz, v = 310 m/s, λ = wavelength = ?

v = fλ

λ = v/f = 310/420 = 0.738 m

T = periodic time of the wave = 1/420 = 0.00238 s = 0.0024 s = 2.4 ms

a) Two points that differ in phase by π/8 rad

In terms of the wavelength of the wave, this is equivalent to [(π/8)/2π] fraction of a wavelength,

[(π/8)/2π] = 1/16 of a wavelength = (1/16) × 0.738 = 0.0461 m

b) two displacements at times 1.6 ms apart.

In terms of periodic time, 1.6ms is (1.6/2.4) fraction of the periodic time.

1.6/2.4 = 2/3.

This means those two points are 2/3 fraction of a periodic time away from each other.

1 complete wave = 2π rad

Points 2/3 fraction of a wave from each other will have a phase difference of 2/3 × 2π = 4π/3.

8 0
3 years ago
you have a permanent magnet whit remanent induction. than you cut a piec of that magnet. if you put that piece back into permane
ELEN [110]
Yes, it will. The induction will be the same as long as it’s put back together.
5 0
3 years ago
This assignment is designed to test your understanding of graphical user interface components and Event Driven programming in Ja
lys-0071 [83]

Answer:

Java program is given below

Explanation:

JavaPadGUI.java

package javapad.gui;

import java.awt.BorderLayout;

import java.awt.Container;

import java.awt.Dimension;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.event.WindowAdapter;

import java.awt.event.WindowEvent;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JScrollPane;

import javax.swing.JTextArea;

public class JavaPadGUI extends JFrame implements ActionListener{

  //constants

  private static final String TITLE = "Macrosoft JavaPad XP";

  private static final String SLOGAN = "Macrosoft: Resistance is futile";

 

  //button names

  private static final String NEW = "New";

  private static final String LOAD = "Load";

  private static final String SAVE = "Save";

  private static final String QUIT = "Quit";

 

  private static final String FILENAME = "hardcode.txt";

  //messages

 

  private static final String QUIT_MSG = "Quitting, Save?";

  private static final String LOAD_ERR = "Could not access file " + FILENAME;

 

 

  //fields

  private JTextArea txtContent;

  private JButton butNew, butLoad, butSave, butQuit;

 

  public JavaPadGUI()

  {

      super(TITLE);

      createUI();

      setSize(new Dimension(400, 300));

      setDefaultCloseOperation(EXIT_ON_CLOSE);

         

  }

 

  private void createUI()

  {

      Container c = getContentPane();

      c.setLayout(new BorderLayout(30,30));

     

      //create the buttons panel

      JPanel butPanel = new JPanel();

      butPanel.add(butNew = new JButton(NEW));

      butPanel.add(butLoad = new JButton(LOAD));

      butPanel.add(butSave = new JButton(SAVE));

      butPanel.add(butQuit = new JButton(QUIT));

     

      //set command names for the buttons, these will be when button is clicked

      butNew.setActionCommand(NEW);

      butLoad.setActionCommand(LOAD);

      butSave.setActionCommand(SAVE);

      butQuit.setActionCommand(QUIT);

     

      JPanel sloganPanel = new JPanel();

      sloganPanel.add(new JLabel(SLOGAN));

     

      //create textarea with scrollbar

      txtContent = new JTextArea(15, 25);

      txtContent.setLineWrap(true);

         

      JScrollPane scroll = new JScrollPane(txtContent);

     

      //now add all components

      c.add(butPanel, BorderLayout.NORTH);

      c.add(scroll, BorderLayout.CENTER);

      c.add(sloganPanel, BorderLayout.SOUTH);

     

     

      //set the actionlistner to buttons to handle button click event

      butNew.addActionListener(this);

      butLoad.addActionListener(this);

      butSave.addActionListener(this);

      butQuit.addActionListener(this);

     

  }

  public void actionPerformed(ActionEvent e)

  {

      String cmd = e.getActionCommand();

      if(cmd.equals(NEW))

          txtContent.setText("");

      else if (cmd.equals(LOAD))

          load();

      else if(cmd.equals(SAVE))

          save();

      else if (cmd.equals(QUIT))

          quit();

  }

  private void quit()

  {

      int option = JOptionPane.showConfirmDialog(this, QUIT_MSG);

      if(option == JOptionPane.YES_OPTION)

      {

          save();

      }

     

      System.exit(0);

  }

 

  private void save()

  {

      try {

          PrintWriter w = new PrintWriter(new File(FILENAME));

          w.write(txtContent.getText());

          w.close();

      } catch (FileNotFoundException e) {

          JOptionPane.showMessageDialog(this,"I/O Error", LOAD_ERR, JOptionPane.ERROR_MESSAGE);

      }

             

  }

  private void load()

  {

      try {

          Scanner s = new Scanner(new File(FILENAME));

          String str = "";

          while(s.hasNextLine())

              str += s.nextLine();

          txtContent.setText(str);

          s.close();

      } catch (FileNotFoundException e) {

          JOptionPane.showMessageDialog(this, LOAD_ERR, "I/O Error",JOptionPane.ERROR_MESSAGE);

      }

     

  }

}

RunJavaPad.java

package javapad;

import javapad.gui.JavaPadGUI;

public class RunJavaPad {

  public static void main(String[] args) {

      JavaPadGUI gui = new JavaPadGUI();

      gui.setVisible(true);

  }

}

7 0
3 years ago
Other questions:
  • What is the difference between a job and a profession
    9·1 answer
  • Consider the following program:
    15·1 answer
  • Rosalind franklin<br> What was she famous for
    14·1 answer
  • At a certain location, wind is blowing steadily at 10 m/s. Determine the mechanical energy of air per unit mass and the power ge
    5·1 answer
  • What is torque and how does it work?
    14·2 answers
  • The formula for the cross sectional area of specimen at the middle is
    5·1 answer
  • (1) Estimate the specific volume in cm3 /g for carbon dioxide at 310 K and (a) 8 bar (b) 75 bar by the virial equation and compa
    10·1 answer
  • Which of these people is an engineer?
    13·1 answer
  • List six possible valve defects that should be included in the inspection of a used valve?
    7·1 answer
  • What is resonance as in ultrasound waves formation using magnetostriction method​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!