Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary cst8116lab1

Rating
-
Sold
-
Pages
3
Uploaded on
04-06-2023
Written in
2022/2023

this is cst 8116 lab assignment1

Institution
Module

Content preview

CREATE A JAVA PROGRAM THAT WILL

TAKE THE VARIABLES (NAME, LASTNAME AND OPTIONAL STUDENT NUMBER)

PRINT THEM AGAIN BUT USE THEM AS PIG LATIN

TO DO PIG LATIN,

TAKE THE FIRST CHARACTER,

PUT IT AT THE END,

AND ADD “AY”

FOR INSTANCE “DANIEL” BECOMES “ANIELDAY”.

“CORMIER” BECOMES “ORMIERCAY”.

The code

package PigLatinConverter;

import java.util.Scanner;

public class PigLatinConverter1 {

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

// Input variables

System.out.print("Enter your name: ");

String name = scanner.nextLine();

System.out.print("Enter your last name: ");

String lastName = scanner.nextLine();

System.out.print("Enter your student number (optional): ");

String studentNumber = scanner.nextLine();

// Convert to Pig Latin

String pigLatinName = convertToPigLatin(name);

String pigLatinLastName = convertToPigLatin(lastName);

String pigLatinStudentNumber = convertToPigLatin(studentNumber);

// Print Pig Latin values

Written for

Institution
Study
Module

Document information

Uploaded on
June 4, 2023
Number of pages
3
Written in
2022/2023
Type
SUMMARY

Subjects

£6.59
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
nkamsehsomebodyvincentbonsi

Get to know the seller

Seller avatar
nkamsehsomebodyvincentbonsi algonquin college
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
6
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions