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
d1i1m1o1n [39]
3 years ago
11

Write a code segment that displays the values of the integers x, y, and z on a single line, such that each value is right-justif

ied with a field width of 6.
Computers and Technology
1 answer:
Elena L [17]3 years ago
3 0

Answer:

x = int(input ("enter first number: "))

y = int(input ("enter second number: "))

z = int(input ("enter third number: "))

print('%6d %6d %6d' %(x,y,z))

Explanation:

Using python programming language we receive three integers variables (x,y,z) then using string formatting (%6) which specifies that the output should be right justified with a width of 6, the values are printed out.

You might be interested in
Which of the following scenarios demonstrates leadership?
bulgar [2K]
I can’t see the scenarios bro
8 0
3 years ago
Read 2 more answers
Rosa is a high school freshman with no savings. She wants to buy a new smartphone in a few months for $300. Which account type b
Iteru [2.4K]
Simple savings account
6 0
3 years ago
Read 2 more answers
Suppose you are provided with 2 strings to your program. Your task is to join the strings together so you get a single string wi
Mariulka [41]

Answer:

public class TestImport{

   public static void main(String[] args) {

       String string1 = args[1];

       String string2 = args[2];

       System.out.println(string1 +" " +string2);

   }

}

Explanation:

The solution here is to use string concatenation as has been used in this statement System.out.println(string1 +" " +string2);

When this code is run from the command line and passed atleast three command line arguments for index 0,1,2 respectively, the print statment will return the second string (that is index1) and the third argument(that is index2) with a space in-between the two string.

6 0
3 years ago
#Create a class called Name. Name should have two attributes
prisoha [69]

Answer:

//class Name

class Name {

// attributes gave you 3

String first_name;

String last_name;

int length = 0;

//constructor with 2 parameters

Name(String first_name, String last_name){

}

//methods

public String find_printed_name(){

return first_name + " " + last_name;

}

public void find_sortable_name(){

return last_name + ", " first_name.charAt(0);

}

public static void main(String[] args){

// instantiate the class

Name test_name = new Name("David", "Joyner");

System.out.println(test_name.first_name);

System.out.println(test_name.last_name);

System.out.println(test_name.find_printed_name());

System.out.println(test_name.find_sortable_name());

}

Explanation:

You didn't specify a language so I did it in Java.

You should know how to declare methods in Python.

3 0
3 years ago
Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect
Irina18 [472]

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Name");

       String name = in.next();

       System.out.println("Enter Age");

       int age = in.nextInt();

       System.out.println("The age of "+name +" is "+age);

   }

}

Explanation:

Java programming language is used to write the code.

The scanner class is used to prompt and receive values for name and age which are stored in the appropriate variables.

The key idea here is using string concatenation in the output statement in order to print the desired output

3 0
3 years ago
Other questions:
  • Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a
    14·1 answer
  • The open items on your computer are displayed here.
    12·1 answer
  • Tiffany is an instructor at a college that is run on student tuition and not state taxes. Which statement best describes her emp
    6·2 answers
  • What is a perfect hashing function?
    13·1 answer
  • What are the disadvantages of using pointers?
    6·1 answer
  • The purpose of maintaining a network of digital forensics specialists is to develop a list of colleagues who specialize in areas
    7·2 answers
  • What are 25 items that trees made?
    6·2 answers
  • In this lab, your task is to complete the following: Enable all of the necessary ports on each networking device that will allow
    9·1 answer
  • Please please help I don’t understand
    6·1 answer
  • What is one disadvantage people face without a checking account?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!